diff --git a/PWGLF/Tasks/QC/mcParticlePrediction.cxx b/PWGLF/Tasks/QC/mcParticlePrediction.cxx index bffb725f841..6ea444b5597 100644 --- a/PWGLF/Tasks/QC/mcParticlePrediction.cxx +++ b/PWGLF/Tasks/QC/mcParticlePrediction.cxx @@ -59,6 +59,14 @@ static const std::vector parameterNames{"Enable"}; static constexpr int nParameters = 1; static const int defaultParticles[PIDExtended::NIDsTot][nParameters]{{0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {1}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}, {0}}; bool enabledParticlesArray[PIDExtended::NIDsTot]; +static constexpr bool isResonance(PIDExtended::ID id) +{ + return id == PIDExtended::Phi || + id == PIDExtended::Kstar || + id == PIDExtended::KstarPM || + id == PIDExtended::Xi1530 || + id == PIDExtended::Lambda1520; +} // Estimators struct Estimators { @@ -316,6 +324,15 @@ struct McParticlePrediction { h->GetXaxis()->SetBinLabel(i + 1, PIDExtended::getName(i)); } + auto hBefore = histos.add("particles/idBeforePrimarySelection", "", kTH1D, {{PIDExtended::NIDsTot, -0.5, PIDExtended::NIDsTot - 0.5}}); + + auto hAfter = histos.add("particles/idAfterPrimarySelection", "", kTH1D, {{PIDExtended::NIDsTot, -0.5, PIDExtended::NIDsTot - 0.5}}); + + for (int i = 0; i < PIDExtended::NIDsTot; ++i) { + hBefore->GetXaxis()->SetBinLabel(i + 1, PIDExtended::getName(i)); + hAfter->GetXaxis()->SetBinLabel(i + 1, PIDExtended::getName(i)); + } + for (int i = 0; i < Estimators::nEstimators; i++) { if (!enabledEstimatorsArray[i]) { continue; @@ -467,6 +484,18 @@ struct McParticlePrediction { if (enabledEstimatorsArray[Estimators::ZNC]) { nMult[Estimators::ZNC] = mCounter.countZNC(mcParticles); } + if (enabledEstimatorsArray[Estimators::ZEM1]) { + nMult[Estimators::ZEM1] = 0; // Not implemented yet + } + if (enabledEstimatorsArray[Estimators::ZEM2]) { + nMult[Estimators::ZEM2] = 0; // Not implemented yet + } + if (enabledEstimatorsArray[Estimators::ZPA]) { + nMult[Estimators::ZPA] = 0; // Not implemented yet + } + if (enabledEstimatorsArray[Estimators::ZPC]) { + nMult[Estimators::ZPC] = 0; // Not implemented yet + } if (enabledEstimatorsArray[Estimators::ITSIB] || enableVsITSHistograms) { nMult[Estimators::ITSIB] = mCounter.countITSIB(mcParticles); } @@ -541,10 +570,21 @@ struct McParticlePrediction { continue; } - if (!particle.isPhysicalPrimary()) { + // if (!particle.isPhysicalPrimary()) { + // continue; + // } + + // Count ids before applying the primary selection + histos.fill(HIST("particles/idBeforePrimarySelection"), id); + + // Keep supported resonances even if they are not marked as physical primaries + if (selectPrimaries.value && !isResonance(id) && !particle.isPhysicalPrimary()) { continue; } + // Count ids surviving the selection + histos.fill(HIST("particles/idAfterPrimarySelection"), id); + const TParticlePDG* p = pdgDB->GetParticle(particle.pdgCode()); if (p) { if (std::abs(p->Charge()) > chargetolerance) { @@ -559,7 +599,7 @@ struct McParticlePrediction { histos.fill(HIST("particles/y/undefined"), particle.y()); } - if (std::abs(particle.pt()) < ptCut.value) { // Fill the eta and rapidity histograms only for particles above the pt cut + if (std::abs(particle.pt()) > ptCut.value) { // Fill the eta and rapidity histograms only for particles above the pt cut for (int i = 0; i < Estimators::nEstimators; i++) { if (!enabledEstimatorsArray[i]) { continue;