4141
4242#include < TH1.h>
4343#include < TH2.h>
44+ #include < TPDGCode.h>
4445#include < TParticlePDG.h>
4546#include < TString.h>
4647
@@ -446,6 +447,9 @@ struct mcParticlePrediction {
446447 return nMult;
447448 }
448449
450+ int noOfDaughters = 2 ;
451+ float rapidityMother = 0.5 ;
452+
449453 void process (aod::McCollision const & mcCollision,
450454 aod::McParticles const & mcParticles)
451455 {
@@ -493,9 +497,9 @@ struct mcParticlePrediction {
493497 continue ;
494498 }
495499
496- if (!particle.isPhysicalPrimary ()) {
497- continue ;
498- }
500+ // if (!particle.isPhysicalPrimary()) {
501+ // continue;
502+ // }
499503
500504 TParticlePDG* p = pdgDB->GetParticle (particle.pdgCode ());
501505 if (p) {
@@ -506,21 +510,92 @@ struct mcParticlePrediction {
506510 }
507511 }
508512
509- if (std::abs (particle.y ()) > 0.5 ) {
513+ if (std::abs (particle.y ()) >= rapidityMother ) {
510514 continue ;
511515 }
512516
513- histos.fill (HIST (" particles/vtx/x" ), particle.vx ());
514- histos.fill (HIST (" particles/vtx/y" ), particle.vy ());
515- histos.fill (HIST (" particles/vtx/z" ), particle.vz () - mcCollision.posZ ());
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+ }
529+
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 ;
534+ }
535+ }
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+ }
516555
517- histos.fill (HIST (" particles/yields" ), id);
518- for (int i = 0 ; i < Estimators::nEstimators; i++) {
519- if (!enabledEstimatorsArray[i]) {
556+ auto passkaonPos = false ;
557+ auto passkaonNeg = false ;
558+ for (const auto & kCurrentDaughter : kDaughters ) {
559+ if (!kCurrentDaughter .isPhysicalPrimary ()) {
560+ continue ;
561+ }
562+
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 ()) {
520585 continue ;
521586 }
522- hpt[i][id]->Fill (particle.pt (), nMult[i]);
523- hyield[i][id]->Fill (nMult[i]);
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+ }
524599 }
525600 }
526601 }
0 commit comments