Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 42 additions & 2 deletions PWGLF/Tasks/QC/mcParticlePrediction.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,14 @@ static const std::vector<std::string> 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 {
Expand Down Expand Up @@ -316,6 +324,15 @@ struct McParticlePrediction {
h->GetXaxis()->SetBinLabel(i + 1, PIDExtended::getName(i));
}

auto hBefore = histos.add<TH1>("particles/idBeforePrimarySelection", "", kTH1D, {{PIDExtended::NIDsTot, -0.5, PIDExtended::NIDsTot - 0.5}});

auto hAfter = histos.add<TH1>("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;
Expand Down Expand Up @@ -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);
}
Expand Down Expand Up @@ -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) {
Expand All @@ -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;
Expand Down
Loading