|
47 | 47 | #include "PWGHF/Core/SelectorCuts.h" |
48 | 48 | #include "PWGHF/Utils/utilsTrkCandHf.h" |
49 | 49 | #include "PWGHF/DataModel/CandidateReconstructionTables.h" |
50 | | -#include "PWGHF/DataModel/CandidateSelectionTables.h" |
51 | 50 |
|
52 | 51 | using namespace o2; |
53 | 52 | using namespace o2::framework; |
@@ -257,7 +256,7 @@ struct HfTreeCreatorOmegacSt { |
257 | 256 | using TracksExt = soa::Join<aod::TracksIU, aod::TracksCovIU, aod::TracksExtra, aod::TracksDCA, aod::pidTPCPi, aod::pidTPCKa, aod::pidTPCPr, aod::pidTOFPi, aod::pidTOFKa, aod::pidTOFPr>; |
258 | 257 | using TracksExtMc = soa::Join<TracksExt, aod::McTrackLabels>; |
259 | 258 |
|
260 | | - Filter collisionFilter = (!useSel8Trigger.node()) || (o2::aod::evsel::sel8 == true); |
| 259 | + Filter collisionFilter = (useSel8Trigger.node() == false) || (o2::aod::evsel::sel8 == true); |
261 | 260 |
|
262 | 261 | // Preslice<aod::Tracks> perCol = aod::track::collisionId; |
263 | 262 | PresliceUnsorted<aod::TrackAssoc> trackIndicesPerCollision = aod::track_association::collisionId; |
@@ -337,6 +336,7 @@ struct HfTreeCreatorOmegacSt { |
337 | 336 | std::vector<int> idxBhadMothers{}; |
338 | 337 | int decayChannel = -1; // flag for different decay channels |
339 | 338 | const int nProngs = 2; |
| 339 | + bool isMatched = false; |
340 | 340 |
|
341 | 341 | void processMc(aod::McCollisions const&, |
342 | 342 | aod::McParticles const& mcParticles) |
@@ -364,14 +364,14 @@ struct HfTreeCreatorOmegacSt { |
364 | 364 | } |
365 | 365 | } |
366 | 366 | if (idxPionDaughter >= 0 && idxCascDaughter >= 0) { |
367 | | - decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi; // OmegaC -> Omega + Pi |
| 367 | + decayChannel = o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi; // OmegaC -> Omega + Pi |
368 | 368 | } else if (idxKaonDaughter >= 0 && idxCascDaughter >= 0) { |
369 | | - decayChannel = hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK; // OmegaC -> Omega + K |
| 369 | + decayChannel = o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK; // OmegaC -> Omega + K |
370 | 370 | } else { |
371 | 371 | LOG(warning) << "Decay channel not recognized!"; |
372 | 372 | } |
373 | 373 | if (decayChannel != -1) { |
374 | | - int idxDaughter = (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter; |
| 374 | + int idxDaughter = (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) ? idxPionDaughter : idxKaonDaughter; |
375 | 375 | auto particle = mcParticles.rawIteratorAt(idxDaughter); |
376 | 376 | origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); |
377 | 377 |
|
@@ -416,7 +416,8 @@ struct HfTreeCreatorOmegacSt { |
416 | 416 | template <typename TracksType> |
417 | 417 | void fillTable(Collisions const& collisions, |
418 | 418 | aod::AssignedTrackedCascades const& trackedCascades, |
419 | | - aod::TrackAssoc const& trackIndices) |
| 419 | + aod::TrackAssoc const& trackIndices, |
| 420 | + std::optional<aod::McParticles> mcParticles = std::nullopt) |
420 | 421 | { |
421 | 422 | const auto matCorr = static_cast<o2::base::Propagator::MatCorrType>(materialCorrectionType.value); |
422 | 423 |
|
@@ -640,58 +641,58 @@ struct HfTreeCreatorOmegacSt { |
640 | 641 | registry.fill(HIST("hMassOmegaKVsPt"), massOmegaK, RecoDecay::pt(momenta[0], momenta[1])); |
641 | 642 |
|
642 | 643 | //--- do the MC Rec match |
643 | | - auto arrayDaughters = std::array{ |
644 | | - trackId.template track_as<TracksExtMc>, // bachelor <- charm baryon |
645 | | - casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade |
646 | | - V0.posTrack_as<TracksExtMc>(), // p <- lambda |
647 | | - V0.negTrack_as<TracksExtMc> // pi <- lambda |
648 | | - }; |
649 | | - auto arrayDaughtersCasc = std::array{ |
650 | | - casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade |
651 | | - V0.posTrack_as<TracksExtMc>(), // p <- lambda |
652 | | - V0.negTrack_as<TracksExtMc> // pi <- lambda |
653 | | - }; |
654 | | - auto arrayDaughtersV0 = std::array{ |
655 | | - V0.posTrack_as<TracksExtMc>(), // p <- lambda |
656 | | - V0.negTrack_as<TracksExtMc> // pi <- lambda |
657 | | - }; |
658 | | - |
659 | | - if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { |
660 | | - // Match Omegac0 → Omega- + Pi+ |
661 | | - indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles, arrayDaughters, +kOmegaC0, |
662 | | - std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); |
663 | | - } else if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { |
664 | | - // Match Omegac0 → Omega- + K+ |
665 | | - indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles, arrayDaughters, +kOmegaC0, |
666 | | - std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); |
667 | | - } |
668 | | - |
669 | | - indexRecCharmBaryon = indexRec; |
670 | | - if (indexRec->- 1) { |
671 | | - // Omega- → K pi p (Cascade match) |
672 | | - indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc); |
673 | | - if (indexRec->- 1) { |
674 | | - // Lambda → p pi (Lambda match) |
675 | | - indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles, arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0); |
676 | | - if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { |
677 | | - if (nPiToMuOmegac0 >= 1 && nKaToPiOmegac0 == 0) { |
678 | | - isMatched = true; |
679 | | - } else if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) { |
680 | | - isMatched = true; |
681 | | - } |
682 | | - } else if (decayChannel == hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { |
683 | | - if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) { |
684 | | - isMatched = true; |
| 644 | + if (mcParticles) { |
| 645 | + auto arrayDaughters = std::array{ |
| 646 | + trackId.template track_as<TracksExtMc>(), // bachelor <- charm baryon |
| 647 | + casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade |
| 648 | + v0.posTrack_as<TracksExtMc>(), // p <- lambda |
| 649 | + v0.negTrack_as<TracksExtMc>()}; // pi <- lambda |
| 650 | + |
| 651 | + auto arrayDaughtersCasc = std::array{ |
| 652 | + casc.bachelor_as<TracksExtMc>(), // bachelor <- cascade |
| 653 | + v0.posTrack_as<TracksExtMc>(), // p <- lambda |
| 654 | + v0.negTrack_as<TracksExtMc>()}; // pi <- lambda |
| 655 | + auto arrayDaughtersV0 = std::array{ |
| 656 | + v0.posTrack_as<TracksExtMc>(), // p <- lambda |
| 657 | + v0.negTrack_as<TracksExtMc>()}; // pi <- lambda |
| 658 | + |
| 659 | + if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { |
| 660 | + // Match Omegac0 → Omega- + Pi+ |
| 661 | + indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles.value(), arrayDaughters, o2::constants::physics::kOmegaC0, |
| 662 | + std::array{+kPiPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); |
| 663 | + } else if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { |
| 664 | + // Match Omegac0 → Omega- + K+ |
| 665 | + indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, false>(mcParticles.value(), arrayDaughters, o2::constants::physics::kOmegaC0, |
| 666 | + std::array{+kKPlus, +kKMinus, +kProton, +kPiMinus}, true, &sign, 3, &nPiToMuOmegac0, &nKaToPiOmegac0); |
| 667 | + } |
| 668 | + indexRecCharmBaryon = indexRec; |
| 669 | + if (indexRec > -1) { |
| 670 | + // Omega- → K pi p (Cascade match) |
| 671 | + indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles.value(), arrayDaughtersCasc, +kOmegaMinus, std::array{+kKMinus, +kProton, +kPiMinus}, true, &signCasc, 2, &nPiToMuCasc, &nKaToPiCasc); |
| 672 | + if (indexRec > -1) { |
| 673 | + // Lambda → p pi (Lambda match) |
| 674 | + indexRec = RecoDecay::getMatchedMCRec<false, true, false, true, true>(mcParticles.value(), arrayDaughtersV0, +kLambda0, std::array{+kProton, +kPiMinus}, true, &signV0, 1, &nPiToMuV0); |
| 675 | + if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaPi) { |
| 676 | + if (nPiToMuOmegac0 >= 1 && nKaToPiOmegac0 == 0) { |
| 677 | + isMatched = true; |
| 678 | + } else if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) { |
| 679 | + isMatched = true; |
| 680 | + } |
| 681 | + } else if (decayChannel == o2::aod::hf_cand_casc_lf::DecayType2Prong::OmegaczeroToOmegaK) { |
| 682 | + if (nPiToMuOmegac0 == 0 && nKaToPiOmegac0 == 0) { |
| 683 | + isMatched = true; |
| 684 | + } |
685 | 685 | } |
686 | 686 | } |
687 | 687 | } |
688 | | - } |
689 | | - if (isMatched) { |
690 | | - auto particle = mcParticles.rawIteratorAt(indexRecCharmBaryon); |
691 | | - origin = RecoDecay::getCharmHadronOrigin(mcParticles, particle, false, &idxBhadMothers); |
| 688 | + if (isMatched) { |
| 689 | + auto particle = mcParticles.value().rawIteratorAt(indexRecCharmBaryon); |
| 690 | + origin = RecoDecay::getCharmHadronOrigin(mcParticles.value(), particle, false, &idxBhadMothers); |
| 691 | + } |
692 | 692 | } |
693 | 693 |
|
694 | | - if ((std::abs(massOmegaC - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) || |
| 694 | + if ((std::abs(massOmegaK - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) || |
| 695 | + (std::abs(massOmegaPi - o2::constants::physics::MassOmegaC0) < massWindowOmegaC) || |
695 | 696 | (std::abs(massXiC - o2::constants::physics::MassXiC0) < massWindowXiC)) { |
696 | 697 | registry.fill(HIST("hDecayLength"), decayLength * 1e4); |
697 | 698 | registry.fill(HIST("hDecayLengthScaled"), decayLength * o2::constants::physics::MassOmegaC0 / RecoDecay::p(momenta[0], momenta[1]) * 1e4); |
@@ -786,10 +787,10 @@ struct HfTreeCreatorOmegacSt { |
786 | 787 | aod::V0s const&, |
787 | 788 | // TracksExt const& tracks, // TODO: should be TracksExtMc |
788 | 789 | TracksExtMc const&, |
789 | | - aod::McParticles const&, |
| 790 | + aod::McParticles const& mcParticles, |
790 | 791 | aod::BCsWithTimestamps const&) |
791 | 792 | { |
792 | | - fillTable<TracksExtMc>(collisions, trackedCascades, trackIndices); |
| 793 | + fillTable<TracksExtMc>(collisions, trackedCascades, trackIndices, mcParticles); |
793 | 794 | } |
794 | 795 | PROCESS_SWITCH(HfTreeCreatorOmegacSt, processMcRec, "Process MC reco", true); |
795 | 796 |
|
@@ -878,7 +879,7 @@ struct HfTreeCreatorOmegacSt { |
878 | 879 |
|
879 | 880 | trackParCovCasc.getPxPyPzGlo(momenta[0]); |
880 | 881 | trackParCovPion.getPxPyPzGlo(momenta[1]); |
881 | | - registry.fill(HIST("hDeltaPtVsPt"), mcpart.pt(), (trackParCovPionOrKaon.getPt() - mcpart.pt()) / mcpart.pt()); |
| 882 | + registry.fill(HIST("hDeltaPtVsPt"), mcpart.pt(), (trackParCovPion.getPt() - mcpart.pt()) / mcpart.pt()); |
882 | 883 | registry.fill(HIST("hMassOmegacId"), RecoDecay::m(momenta, masses)); |
883 | 884 |
|
884 | 885 | hCandidatesCascPiOrK->Fill(SVFitting::BeforeFit); |
|
0 commit comments