Skip to content

Commit 7ad8a90

Browse files
authored
Physical primary check for the daughters of decaying particles
1 parent 8ab6cfa commit 7ad8a90

1 file changed

Lines changed: 26 additions & 79 deletions

File tree

PWGLF/Tasks/QC/mcParticlePrediction.cxx

Lines changed: 26 additions & 79 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@
4141

4242
#include <TH1.h>
4343
#include <TH2.h>
44-
#include <TPDGCode.h>
4544
#include <TParticlePDG.h>
4645
#include <TString.h>
4746

@@ -195,6 +194,7 @@ struct mcParticlePrediction {
195194
Configurable<bool> enableVsEta05Histograms{"enableVsEta05Histograms", true, "Enables the correlation between ETA05 and other estimators"};
196195
Configurable<bool> enableVsEta08Histograms{"enableVsEta08Histograms", true, "Enables the correlation between ETA08 and other estimators"};
197196
Configurable<bool> enableVsImpactParameterHistograms{"enableVsImpactParameterHistograms", true, "Enables the correlation between impact parameter and other estimators"};
197+
Configurable<float> rapidityMother{"rapidityMother", 0.5, "Mother particle rapidity"};
198198

199199
Service<o2::framework::O2DatabasePDG> pdgDB;
200200
o2::pwglf::ParticleCounter<o2::framework::O2DatabasePDG> mCounter;
@@ -447,9 +447,6 @@ struct mcParticlePrediction {
447447
return nMult;
448448
}
449449

450-
int noOfDaughters = 2;
451-
float rapidityMother = 0.5;
452-
453450
void process(aod::McCollision const& mcCollision,
454451
aod::McParticles const& mcParticles)
455452
{
@@ -514,88 +511,38 @@ struct mcParticlePrediction {
514511
continue;
515512
}
516513

517-
if (particle.pdgCode() == o2::constants::physics::kK0Star892) {
518-
auto kDaughters = particle.daughters_as<aod::McParticles>();
519-
if (kDaughters.size() != noOfDaughters) {
520-
continue;
521-
}
522-
523-
auto passkaon = false;
524-
auto passpion = false;
525-
for (const auto& kCurrentDaughter : kDaughters) {
526-
if (!kCurrentDaughter.isPhysicalPrimary()) {
527-
continue;
528-
}
514+
// Check if particle has daughters (not a final state particle)
515+
auto daughters = particle.daughters_as<aod::McParticles>();
516+
bool isValid = false;
529517

530-
if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kKPlus) {
531-
passkaon = true;
532-
} else if (std::abs(kCurrentDaughter.pdgCode()) == PDG_t::kPiPlus) {
533-
passpion = true;
518+
if (daughters.size() > 0) {
519+
isValid = true;
520+
for (const auto& daughter : daughters) {
521+
if (!daughter.isPhysicalPrimary()) {
522+
isValid = false;
523+
break;
534524
}
535525
}
536-
if (passkaon && passpion) {
537-
histos.fill(HIST("particles/vtx/x"), particle.vx());
538-
histos.fill(HIST("particles/vtx/y"), particle.vy());
539-
histos.fill(HIST("particles/vtx/z"), particle.vz() - mcCollision.posZ());
540-
541-
histos.fill(HIST("particles/yields"), id);
542-
for (int i = 0; i < Estimators::nEstimators; i++) {
543-
if (!enabledEstimatorsArray[i]) {
544-
continue;
545-
}
546-
hpt[i][id]->Fill(particle.pt(), nMult[i]);
547-
hyield[i][id]->Fill(nMult[i]);
548-
}
549-
}
550-
} else if (particle.pdgCode() == o2::constants::physics::kPhi) {
551-
auto kDaughters = particle.daughters_as<aod::McParticles>();
552-
if (kDaughters.size() != noOfDaughters) {
553-
continue;
554-
}
526+
} else {
527+
// Final state particle - check if particle itself is physical primary
528+
isValid = particle.isPhysicalPrimary();
529+
}
555530

556-
auto passkaonPos = false;
557-
auto passkaonNeg = false;
558-
for (const auto& kCurrentDaughter : kDaughters) {
559-
if (!kCurrentDaughter.isPhysicalPrimary()) {
560-
continue;
561-
}
531+
if (!isValid) {
532+
continue;
533+
}
562534

563-
if (kCurrentDaughter.pdgCode() == PDG_t::kKPlus) {
564-
passkaonPos = true;
565-
} else if (kCurrentDaughter.pdgCode() == PDG_t::kKMinus) {
566-
passkaonNeg = true;
567-
}
568-
}
569-
if (passkaonPos && passkaonNeg) {
570-
histos.fill(HIST("particles/vtx/x"), particle.vx());
571-
histos.fill(HIST("particles/vtx/y"), particle.vy());
572-
histos.fill(HIST("particles/vtx/z"), particle.vz() - mcCollision.posZ());
573-
574-
histos.fill(HIST("particles/yields"), id);
575-
for (int i = 0; i < Estimators::nEstimators; i++) {
576-
if (!enabledEstimatorsArray[i]) {
577-
continue;
578-
}
579-
hpt[i][id]->Fill(particle.pt(), nMult[i]);
580-
hyield[i][id]->Fill(nMult[i]);
581-
}
582-
}
583-
} else {
584-
if (!particle.isPhysicalPrimary()) {
535+
histos.fill(HIST("particles/vtx/x"), particle.vx());
536+
histos.fill(HIST("particles/vtx/y"), particle.vy());
537+
histos.fill(HIST("particles/vtx/z"), particle.vz() - mcCollision.posZ());
538+
539+
histos.fill(HIST("particles/yields"), id);
540+
for (int i = 0; i < Estimators::nEstimators; i++) {
541+
if (!enabledEstimatorsArray[i]) {
585542
continue;
586543
}
587-
histos.fill(HIST("particles/vtx/x"), particle.vx());
588-
histos.fill(HIST("particles/vtx/y"), particle.vy());
589-
histos.fill(HIST("particles/vtx/z"), particle.vz() - mcCollision.posZ());
590-
591-
histos.fill(HIST("particles/yields"), id);
592-
for (int i = 0; i < Estimators::nEstimators; i++) {
593-
if (!enabledEstimatorsArray[i]) {
594-
continue;
595-
}
596-
hpt[i][id]->Fill(particle.pt(), nMult[i]);
597-
hyield[i][id]->Fill(nMult[i]);
598-
}
544+
hpt[i][id]->Fill(particle.pt(), nMult[i]);
545+
hyield[i][id]->Fill(nMult[i]);
599546
}
600547
}
601548
}

0 commit comments

Comments
 (0)