|
41 | 41 |
|
42 | 42 | #include <TH1.h> |
43 | 43 | #include <TH2.h> |
44 | | -#include <TPDGCode.h> |
45 | 44 | #include <TParticlePDG.h> |
46 | 45 | #include <TString.h> |
47 | 46 |
|
@@ -195,6 +194,7 @@ struct mcParticlePrediction { |
195 | 194 | Configurable<bool> enableVsEta05Histograms{"enableVsEta05Histograms", true, "Enables the correlation between ETA05 and other estimators"}; |
196 | 195 | Configurable<bool> enableVsEta08Histograms{"enableVsEta08Histograms", true, "Enables the correlation between ETA08 and other estimators"}; |
197 | 196 | Configurable<bool> enableVsImpactParameterHistograms{"enableVsImpactParameterHistograms", true, "Enables the correlation between impact parameter and other estimators"}; |
| 197 | + Configurable<float> rapidityMother{"rapidityMother", 0.5, "Mother particle rapidity"}; |
198 | 198 |
|
199 | 199 | Service<o2::framework::O2DatabasePDG> pdgDB; |
200 | 200 | o2::pwglf::ParticleCounter<o2::framework::O2DatabasePDG> mCounter; |
@@ -447,9 +447,6 @@ struct mcParticlePrediction { |
447 | 447 | return nMult; |
448 | 448 | } |
449 | 449 |
|
450 | | - int noOfDaughters = 2; |
451 | | - float rapidityMother = 0.5; |
452 | | - |
453 | 450 | void process(aod::McCollision const& mcCollision, |
454 | 451 | aod::McParticles const& mcParticles) |
455 | 452 | { |
@@ -514,88 +511,38 @@ struct mcParticlePrediction { |
514 | 511 | continue; |
515 | 512 | } |
516 | 513 |
|
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; |
529 | 517 |
|
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; |
534 | 524 | } |
535 | 525 | } |
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 | + } |
555 | 530 |
|
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 | + } |
562 | 534 |
|
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]) { |
585 | 542 | continue; |
586 | 543 | } |
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]); |
599 | 546 | } |
600 | 547 | } |
601 | 548 | } |
|
0 commit comments