4747#include " PWGHF/DataModel/CandidateReconstructionTables.h"
4848#include " PWGHF/Utils/utilsBfieldCCDB.h"
4949#include " PWGHF/Utils/utilsEvSelHf.h"
50- #include " PWGHF/Utils/utilsTrkCandHf.h"
5150#include " PWGHF/Utils/utilsMcGen.h"
51+ #include " PWGHF/Utils/utilsPid.h"
52+ #include " PWGHF/Utils/utilsTrkCandHf.h"
5253
5354using namespace o2 ;
5455using namespace o2 ::analysis;
@@ -60,11 +61,21 @@ using namespace o2::hf_occupancy;
6061using namespace o2 ::constants::physics;
6162using namespace o2 ::framework;
6263using namespace o2 ::framework::expressions;
64+ using namespace o2 ::aod::pid_tpc_tof_utils;
6365
6466// / Reconstruction of heavy-flavour 3-prong decay candidates
6567struct HfCandidateCreator3Prong {
6668 Produces<aod::HfCand3ProngBase> rowCandidateBase;
6769 Produces<aod::HfCand3ProngKF> rowCandidateKF;
70+ Produces<aod::HfProng0PidPi> rowProng0PidPi;
71+ Produces<aod::HfProng0PidKa> rowProng0PidKa;
72+ Produces<aod::HfProng0PidPr> rowProng0PidPr;
73+ Produces<aod::HfProng1PidPi> rowProng1PidPi;
74+ Produces<aod::HfProng1PidKa> rowProng1PidKa;
75+ Produces<aod::HfProng1PidPr> rowProng1PidPr;
76+ Produces<aod::HfProng2PidPi> rowProng2PidPi;
77+ Produces<aod::HfProng2PidKa> rowProng2PidKa;
78+ Produces<aod::HfProng2PidPr> rowProng2PidPr;
6879
6980 // vertexing
7081 Configurable<bool > propagateToPCA{" propagateToPCA" , true , " create tracks version propagated to PCA" };
@@ -111,6 +122,7 @@ struct HfCandidateCreator3Prong {
111122
112123 using FilteredHf3Prongs = soa::Filtered<aod::Hf3Prongs>;
113124 using FilteredPvRefitHf3Prongs = soa::Filtered<soa::Join<aod::Hf3Prongs, aod::HfPvRefit3Prong>>;
125+ using TracksWCovExtraPidPiKaPr = soa::Join<aod::TracksWCovExtra, aod::TracksPidPi, aod::PidTpcTofFullPi, aod::TracksPidKa, aod::PidTpcTofFullKa, aod::TracksPidPr, aod::PidTpcTofFullPr>;
114126
115127 // filter candidates
116128 Filter filterSelected3Prongs = (createDplus && (o2::aod::hf_track_index::hfflag & static_cast <uint8_t >(BIT(aod::hf_cand_3prong::DecayType::DplusToPiKPi))) != static_cast <uint8_t >(0 )) || (createDs && (o2::aod::hf_track_index::hfflag & static_cast <uint8_t >(BIT(aod::hf_cand_3prong::DecayType::DsToKKPi))) != static_cast <uint8_t >(0 )) || (createLc && (o2::aod::hf_track_index::hfflag & static_cast <uint8_t >(BIT(aod::hf_cand_3prong::DecayType::LcToPKPi))) != static_cast <uint8_t >(0 )) || (createXic && (o2::aod::hf_track_index::hfflag & static_cast <uint8_t >(BIT(aod::hf_cand_3prong::DecayType::XicToPKPi))) != static_cast <uint8_t >(0 ));
@@ -203,7 +215,7 @@ struct HfCandidateCreator3Prong {
203215 template <bool doPvRefit = false , o2::hf_centrality::CentralityEstimator centEstimator, typename Coll, typename Cand>
204216 void runCreator3ProngWithDCAFitterN (Coll const &,
205217 Cand const & rowsTrackIndexProng3,
206- aod::TracksWCovExtra const &,
218+ TracksWCovExtraPidPiKaPr const &,
207219 aod::BCsWithTimestamps const & /* bcWithTimeStamps*/ )
208220 {
209221 // loop over triplets of track indices
@@ -218,9 +230,9 @@ struct HfCandidateCreator3Prong {
218230 continue ;
219231 }
220232
221- auto track0 = rowTrackIndexProng3.template prong0_as <aod::TracksWCovExtra >();
222- auto track1 = rowTrackIndexProng3.template prong1_as <aod::TracksWCovExtra >();
223- auto track2 = rowTrackIndexProng3.template prong2_as <aod::TracksWCovExtra >();
233+ auto track0 = rowTrackIndexProng3.template prong0_as <TracksWCovExtraPidPiKaPr >();
234+ auto track1 = rowTrackIndexProng3.template prong1_as <TracksWCovExtraPidPiKaPr >();
235+ auto track2 = rowTrackIndexProng3.template prong2_as <TracksWCovExtraPidPiKaPr >();
224236 auto trackParVar0 = getTrackParCov (track0);
225237 auto trackParVar1 = getTrackParCov (track1);
226238 auto trackParVar2 = getTrackParCov (track2);
@@ -342,6 +354,17 @@ struct HfCandidateCreator3Prong {
342354 std::sqrt (impactParameter0.getSigmaZ2 ()), std::sqrt (impactParameter1.getSigmaZ2 ()), std::sqrt (impactParameter2.getSigmaZ2 ()),
343355 rowTrackIndexProng3.prong0Id (), rowTrackIndexProng3.prong1Id (), rowTrackIndexProng3.prong2Id (), nProngsContributorsPV, bitmapProngsContributorsPV,
344356 rowTrackIndexProng3.hfflag ());
357+
358+ // fill candidate prong PID rows
359+ fillProngPid<HfProngSpecies::Pion>(track0, rowProng0PidPi);
360+ fillProngPid<HfProngSpecies::Kaon>(track0, rowProng0PidKa);
361+ fillProngPid<HfProngSpecies::Proton>(track0, rowProng0PidPr);
362+ fillProngPid<HfProngSpecies::Pion>(track1, rowProng1PidPi);
363+ fillProngPid<HfProngSpecies::Kaon>(track1, rowProng1PidKa);
364+ fillProngPid<HfProngSpecies::Proton>(track1, rowProng1PidPr);
365+ fillProngPid<HfProngSpecies::Pion>(track2, rowProng2PidPi);
366+ fillProngPid<HfProngSpecies::Kaon>(track2, rowProng2PidKa);
367+ fillProngPid<HfProngSpecies::Proton>(track2, rowProng2PidPr);
345368
346369 // fill histograms
347370 if (fillHistograms) {
@@ -368,7 +391,7 @@ struct HfCandidateCreator3Prong {
368391 template <bool doPvRefit = false , o2::hf_centrality::CentralityEstimator centEstimator, typename Coll, typename Cand>
369392 void runCreator3ProngWithKFParticle (Coll const &,
370393 Cand const & rowsTrackIndexProng3,
371- aod::TracksWCovExtra const &,
394+ TracksWCovExtraPidPiKaPr const &,
372395 aod::BCsWithTimestamps const & /* bcWithTimeStamps*/ )
373396 {
374397 for (const auto & rowTrackIndexProng3 : rowsTrackIndexProng3) {
@@ -381,9 +404,9 @@ struct HfCandidateCreator3Prong {
381404 continue ;
382405 }
383406
384- auto track0 = rowTrackIndexProng3.template prong0_as <aod::TracksWCovExtra >();
385- auto track1 = rowTrackIndexProng3.template prong1_as <aod::TracksWCovExtra >();
386- auto track2 = rowTrackIndexProng3.template prong2_as <aod::TracksWCovExtra >();
407+ auto track0 = rowTrackIndexProng3.template prong0_as <TracksWCovExtraPidPiKaPr >();
408+ auto track1 = rowTrackIndexProng3.template prong1_as <TracksWCovExtraPidPiKaPr >();
409+ auto track2 = rowTrackIndexProng3.template prong2_as <TracksWCovExtraPidPiKaPr >();
387410
388411 // / Set the magnetic field from ccdb.
389412 // / The static instance of the propagator was already modified in the HFTrackIndexSkimCreator,
@@ -587,6 +610,17 @@ struct HfCandidateCreator3Prong {
587610 chi2geoSecondThird, chi2geoFirstThird, chi2geoFirstSecond,
588611 chi2geo, ldl.first , ldl.second , chi2topo);
589612
613+ // fill candidate prong PID rows
614+ fillProngPid<HfProngSpecies::Pion>(track0, rowProng0PidPi);
615+ fillProngPid<HfProngSpecies::Kaon>(track0, rowProng0PidKa);
616+ fillProngPid<HfProngSpecies::Proton>(track0, rowProng0PidPr);
617+ fillProngPid<HfProngSpecies::Pion>(track1, rowProng1PidPi);
618+ fillProngPid<HfProngSpecies::Kaon>(track1, rowProng1PidKa);
619+ fillProngPid<HfProngSpecies::Proton>(track1, rowProng1PidPr);
620+ fillProngPid<HfProngSpecies::Pion>(track2, rowProng2PidPi);
621+ fillProngPid<HfProngSpecies::Kaon>(track2, rowProng2PidKa);
622+ fillProngPid<HfProngSpecies::Proton>(track2, rowProng2PidPr);
623+
590624 // fill histograms
591625 if (fillHistograms) {
592626 registry.fill (HIST (" hMass3PiKPi" ), massPiKPi);
@@ -609,7 +643,7 @@ struct HfCandidateCreator3Prong {
609643 // / @brief process function using DCA fitter w/ PV refit and w/o centrality selections
610644 void processPvRefitWithDCAFitterN (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
611645 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
612- aod::TracksWCovExtra const & tracks,
646+ TracksWCovExtraPidPiKaPr const & tracks,
613647 aod::BCsWithTimestamps const & bcWithTimeStamps)
614648 {
615649 runCreator3ProngWithDCAFitterN</* doPvRefit*/ true , CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -619,7 +653,7 @@ struct HfCandidateCreator3Prong {
619653 // / @brief process function using DCA fitter w/o PV refit and w/o centrality selections
620654 void processNoPvRefitWithDCAFitterN (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
621655 FilteredHf3Prongs const & rowsTrackIndexProng3,
622- aod::TracksWCovExtra const & tracks,
656+ TracksWCovExtraPidPiKaPr const & tracks,
623657 aod::BCsWithTimestamps const & bcWithTimeStamps)
624658 {
625659 runCreator3ProngWithDCAFitterN</* doPvRefit*/ false , CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -629,7 +663,7 @@ struct HfCandidateCreator3Prong {
629663 // / @brief process function using KFParticle package w/ PV refit and w/o centrality selections
630664 void processPvRefitWithKFParticle (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
631665 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
632- aod::TracksWCovExtra const & tracks,
666+ TracksWCovExtraPidPiKaPr const & tracks,
633667 aod::BCsWithTimestamps const & bcWithTimeStamps)
634668 {
635669 runCreator3ProngWithKFParticle</* doPvRefit*/ true , CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -639,7 +673,7 @@ struct HfCandidateCreator3Prong {
639673 // / @brief process function using KFParticle package w/o PV refit and w/o centrality selections
640674 void processNoPvRefitWithKFParticle (soa::Join<aod::Collisions, aod::EvSels> const & collisions,
641675 FilteredHf3Prongs const & rowsTrackIndexProng3,
642- aod::TracksWCovExtra const & tracks,
676+ TracksWCovExtraPidPiKaPr const & tracks,
643677 aod::BCsWithTimestamps const & bcWithTimeStamps)
644678 {
645679 runCreator3ProngWithKFParticle</* doPvRefit*/ false , CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -655,7 +689,7 @@ struct HfCandidateCreator3Prong {
655689 // / @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0C
656690 void processPvRefitWithDCAFitterNCentFT0C (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const & collisions,
657691 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
658- aod::TracksWCovExtra const & tracks,
692+ TracksWCovExtraPidPiKaPr const & tracks,
659693 aod::BCsWithTimestamps const & bcWithTimeStamps)
660694 {
661695 runCreator3ProngWithDCAFitterN</* doPvRefit*/ true , CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -665,7 +699,7 @@ struct HfCandidateCreator3Prong {
665699 // / @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0C
666700 void processNoPvRefitWithDCAFitterNCentFT0C (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const & collisions,
667701 FilteredHf3Prongs const & rowsTrackIndexProng3,
668- aod::TracksWCovExtra const & tracks,
702+ TracksWCovExtraPidPiKaPr const & tracks,
669703 aod::BCsWithTimestamps const & bcWithTimeStamps)
670704 {
671705 runCreator3ProngWithDCAFitterN</* doPvRefit*/ false , CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -675,7 +709,7 @@ struct HfCandidateCreator3Prong {
675709 // / @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0C
676710 void processPvRefitWithKFParticleCentFT0C (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const & collisions,
677711 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
678- aod::TracksWCovExtra const & tracks,
712+ TracksWCovExtraPidPiKaPr const & tracks,
679713 aod::BCsWithTimestamps const & bcWithTimeStamps)
680714 {
681715 runCreator3ProngWithKFParticle</* doPvRefit*/ true , CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -685,7 +719,7 @@ struct HfCandidateCreator3Prong {
685719 // / @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0C
686720 void processNoPvRefitWithKFParticleCentFT0C (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const & collisions,
687721 FilteredHf3Prongs const & rowsTrackIndexProng3,
688- aod::TracksWCovExtra const & tracks,
722+ TracksWCovExtraPidPiKaPr const & tracks,
689723 aod::BCsWithTimestamps const & bcWithTimeStamps)
690724 {
691725 runCreator3ProngWithKFParticle</* doPvRefit*/ false , CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -701,7 +735,7 @@ struct HfCandidateCreator3Prong {
701735 // / @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0M
702736 void processPvRefitWithDCAFitterNCentFT0M (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const & collisions,
703737 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
704- aod::TracksWCovExtra const & tracks,
738+ TracksWCovExtraPidPiKaPr const & tracks,
705739 aod::BCsWithTimestamps const & bcWithTimeStamps)
706740 {
707741 runCreator3ProngWithDCAFitterN</* doPvRefit*/ true , CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -711,7 +745,7 @@ struct HfCandidateCreator3Prong {
711745 // / @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0M
712746 void processNoPvRefitWithDCAFitterNCentFT0M (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const & collisions,
713747 FilteredHf3Prongs const & rowsTrackIndexProng3,
714- aod::TracksWCovExtra const & tracks,
748+ TracksWCovExtraPidPiKaPr const & tracks,
715749 aod::BCsWithTimestamps const & bcWithTimeStamps)
716750 {
717751 runCreator3ProngWithDCAFitterN</* doPvRefit*/ false , CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -721,7 +755,7 @@ struct HfCandidateCreator3Prong {
721755 // / @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0M
722756 void processPvRefitWithKFParticleCentFT0M (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const & collisions,
723757 FilteredPvRefitHf3Prongs const & rowsTrackIndexProng3,
724- aod::TracksWCovExtra const & tracks,
758+ TracksWCovExtraPidPiKaPr const & tracks,
725759 aod::BCsWithTimestamps const & bcWithTimeStamps)
726760 {
727761 runCreator3ProngWithKFParticle</* doPvRefit*/ true , CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -731,7 +765,7 @@ struct HfCandidateCreator3Prong {
731765 // / @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0M
732766 void processNoPvRefitWithKFParticleCentFT0M (soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const & collisions,
733767 FilteredHf3Prongs const & rowsTrackIndexProng3,
734- aod::TracksWCovExtra const & tracks,
768+ TracksWCovExtraPidPiKaPr const & tracks,
735769 aod::BCsWithTimestamps const & bcWithTimeStamps)
736770 {
737771 runCreator3ProngWithKFParticle</* doPvRefit*/ false , CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
0 commit comments