Skip to content

Commit a75f9bb

Browse files
author
Mattia Faggin
committed
Fill single-track PID tables in cand. creator 3 prong.
1 parent af215c6 commit a75f9bb

File tree

1 file changed

+55
-21
lines changed

1 file changed

+55
-21
lines changed

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 55 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,9 @@
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

5354
using namespace o2;
5455
using namespace o2::analysis;
@@ -60,11 +61,21 @@ using namespace o2::hf_occupancy;
6061
using namespace o2::constants::physics;
6162
using namespace o2::framework;
6263
using namespace o2::framework::expressions;
64+
using namespace o2::aod::pid_tpc_tof_utils;
6365

6466
/// Reconstruction of heavy-flavour 3-prong decay candidates
6567
struct 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));
@@ -205,7 +217,7 @@ struct HfCandidateCreator3Prong {
205217
template <bool doPvRefit = false, o2::hf_centrality::CentralityEstimator centEstimator, typename Coll, typename Cand>
206218
void runCreator3ProngWithDCAFitterN(Coll const&,
207219
Cand const& rowsTrackIndexProng3,
208-
aod::TracksWCovExtra const&,
220+
TracksWCovExtraPidPiKaPr const&,
209221
aod::BCsWithTimestamps const& /*bcWithTimeStamps*/)
210222
{
211223
// loop over triplets of track indices
@@ -220,9 +232,9 @@ struct HfCandidateCreator3Prong {
220232
continue;
221233
}
222234

223-
auto track0 = rowTrackIndexProng3.template prong0_as<aod::TracksWCovExtra>();
224-
auto track1 = rowTrackIndexProng3.template prong1_as<aod::TracksWCovExtra>();
225-
auto track2 = rowTrackIndexProng3.template prong2_as<aod::TracksWCovExtra>();
235+
auto track0 = rowTrackIndexProng3.template prong0_as<TracksWCovExtraPidPiKaPr>();
236+
auto track1 = rowTrackIndexProng3.template prong1_as<TracksWCovExtraPidPiKaPr>();
237+
auto track2 = rowTrackIndexProng3.template prong2_as<TracksWCovExtraPidPiKaPr>();
226238
auto trackParVar0 = getTrackParCov(track0);
227239
auto trackParVar1 = getTrackParCov(track1);
228240
auto trackParVar2 = getTrackParCov(track2);
@@ -344,6 +356,17 @@ struct HfCandidateCreator3Prong {
344356
std::sqrt(impactParameter0.getSigmaZ2()), std::sqrt(impactParameter1.getSigmaZ2()), std::sqrt(impactParameter2.getSigmaZ2()),
345357
rowTrackIndexProng3.prong0Id(), rowTrackIndexProng3.prong1Id(), rowTrackIndexProng3.prong2Id(), nProngsContributorsPV, bitmapProngsContributorsPV,
346358
rowTrackIndexProng3.hfflag());
359+
360+
// fill candidate prong PID rows
361+
fillProngPid<HfProngSpecies::Pion>(track0, rowProng0PidPi);
362+
fillProngPid<HfProngSpecies::Kaon>(track0, rowProng0PidKa);
363+
fillProngPid<HfProngSpecies::Proton>(track0, rowProng0PidPr);
364+
fillProngPid<HfProngSpecies::Pion>(track1, rowProng1PidPi);
365+
fillProngPid<HfProngSpecies::Kaon>(track1, rowProng1PidKa);
366+
fillProngPid<HfProngSpecies::Proton>(track1, rowProng1PidPr);
367+
fillProngPid<HfProngSpecies::Pion>(track2, rowProng2PidPi);
368+
fillProngPid<HfProngSpecies::Kaon>(track2, rowProng2PidKa);
369+
fillProngPid<HfProngSpecies::Proton>(track2, rowProng2PidPr);
347370

348371
// fill histograms
349372
if (fillHistograms) {
@@ -370,7 +393,7 @@ struct HfCandidateCreator3Prong {
370393
template <bool doPvRefit = false, o2::hf_centrality::CentralityEstimator centEstimator, typename Coll, typename Cand>
371394
void runCreator3ProngWithKFParticle(Coll const&,
372395
Cand const& rowsTrackIndexProng3,
373-
aod::TracksWCovExtra const&,
396+
TracksWCovExtraPidPiKaPr const&,
374397
aod::BCsWithTimestamps const& /*bcWithTimeStamps*/)
375398
{
376399
for (const auto& rowTrackIndexProng3 : rowsTrackIndexProng3) {
@@ -383,9 +406,9 @@ struct HfCandidateCreator3Prong {
383406
continue;
384407
}
385408

386-
auto track0 = rowTrackIndexProng3.template prong0_as<aod::TracksWCovExtra>();
387-
auto track1 = rowTrackIndexProng3.template prong1_as<aod::TracksWCovExtra>();
388-
auto track2 = rowTrackIndexProng3.template prong2_as<aod::TracksWCovExtra>();
409+
auto track0 = rowTrackIndexProng3.template prong0_as<TracksWCovExtraPidPiKaPr>();
410+
auto track1 = rowTrackIndexProng3.template prong1_as<TracksWCovExtraPidPiKaPr>();
411+
auto track2 = rowTrackIndexProng3.template prong2_as<TracksWCovExtraPidPiKaPr>();
389412

390413
/// Set the magnetic field from ccdb.
391414
/// The static instance of the propagator was already modified in the HFTrackIndexSkimCreator,
@@ -589,6 +612,17 @@ struct HfCandidateCreator3Prong {
589612
chi2geoSecondThird, chi2geoFirstThird, chi2geoFirstSecond,
590613
chi2geo, ldl.first, ldl.second, chi2topo);
591614

615+
// fill candidate prong PID rows
616+
fillProngPid<HfProngSpecies::Pion>(track0, rowProng0PidPi);
617+
fillProngPid<HfProngSpecies::Kaon>(track0, rowProng0PidKa);
618+
fillProngPid<HfProngSpecies::Proton>(track0, rowProng0PidPr);
619+
fillProngPid<HfProngSpecies::Pion>(track1, rowProng1PidPi);
620+
fillProngPid<HfProngSpecies::Kaon>(track1, rowProng1PidKa);
621+
fillProngPid<HfProngSpecies::Proton>(track1, rowProng1PidPr);
622+
fillProngPid<HfProngSpecies::Pion>(track2, rowProng2PidPi);
623+
fillProngPid<HfProngSpecies::Kaon>(track2, rowProng2PidKa);
624+
fillProngPid<HfProngSpecies::Proton>(track2, rowProng2PidPr);
625+
592626
// fill histograms
593627
if (fillHistograms) {
594628
registry.fill(HIST("hMass3PiKPi"), massPiKPi);
@@ -611,7 +645,7 @@ struct HfCandidateCreator3Prong {
611645
/// @brief process function using DCA fitter w/ PV refit and w/o centrality selections
612646
void processPvRefitWithDCAFitterN(soa::Join<aod::Collisions, aod::EvSels> const& collisions,
613647
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
614-
aod::TracksWCovExtra const& tracks,
648+
TracksWCovExtraPidPiKaPr const& tracks,
615649
aod::BCsWithTimestamps const& bcWithTimeStamps)
616650
{
617651
runCreator3ProngWithDCAFitterN</*doPvRefit*/ true, CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -621,7 +655,7 @@ struct HfCandidateCreator3Prong {
621655
/// @brief process function using DCA fitter w/o PV refit and w/o centrality selections
622656
void processNoPvRefitWithDCAFitterN(soa::Join<aod::Collisions, aod::EvSels> const& collisions,
623657
FilteredHf3Prongs const& rowsTrackIndexProng3,
624-
aod::TracksWCovExtra const& tracks,
658+
TracksWCovExtraPidPiKaPr const& tracks,
625659
aod::BCsWithTimestamps const& bcWithTimeStamps)
626660
{
627661
runCreator3ProngWithDCAFitterN</*doPvRefit*/ false, CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -631,7 +665,7 @@ struct HfCandidateCreator3Prong {
631665
/// @brief process function using KFParticle package w/ PV refit and w/o centrality selections
632666
void processPvRefitWithKFParticle(soa::Join<aod::Collisions, aod::EvSels> const& collisions,
633667
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
634-
aod::TracksWCovExtra const& tracks,
668+
TracksWCovExtraPidPiKaPr const& tracks,
635669
aod::BCsWithTimestamps const& bcWithTimeStamps)
636670
{
637671
runCreator3ProngWithKFParticle</*doPvRefit*/ true, CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -641,7 +675,7 @@ struct HfCandidateCreator3Prong {
641675
/// @brief process function using KFParticle package w/o PV refit and w/o centrality selections
642676
void processNoPvRefitWithKFParticle(soa::Join<aod::Collisions, aod::EvSels> const& collisions,
643677
FilteredHf3Prongs const& rowsTrackIndexProng3,
644-
aod::TracksWCovExtra const& tracks,
678+
TracksWCovExtraPidPiKaPr const& tracks,
645679
aod::BCsWithTimestamps const& bcWithTimeStamps)
646680
{
647681
runCreator3ProngWithKFParticle</*doPvRefit*/ false, CentralityEstimator::None>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -657,7 +691,7 @@ struct HfCandidateCreator3Prong {
657691
/// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0C
658692
void processPvRefitWithDCAFitterNCentFT0C(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const& collisions,
659693
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
660-
aod::TracksWCovExtra const& tracks,
694+
TracksWCovExtraPidPiKaPr const& tracks,
661695
aod::BCsWithTimestamps const& bcWithTimeStamps)
662696
{
663697
runCreator3ProngWithDCAFitterN</*doPvRefit*/ true, CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -667,7 +701,7 @@ struct HfCandidateCreator3Prong {
667701
/// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0C
668702
void processNoPvRefitWithDCAFitterNCentFT0C(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const& collisions,
669703
FilteredHf3Prongs const& rowsTrackIndexProng3,
670-
aod::TracksWCovExtra const& tracks,
704+
TracksWCovExtraPidPiKaPr const& tracks,
671705
aod::BCsWithTimestamps const& bcWithTimeStamps)
672706
{
673707
runCreator3ProngWithDCAFitterN</*doPvRefit*/ false, CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -677,7 +711,7 @@ struct HfCandidateCreator3Prong {
677711
/// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0C
678712
void processPvRefitWithKFParticleCentFT0C(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const& collisions,
679713
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
680-
aod::TracksWCovExtra const& tracks,
714+
TracksWCovExtraPidPiKaPr const& tracks,
681715
aod::BCsWithTimestamps const& bcWithTimeStamps)
682716
{
683717
runCreator3ProngWithKFParticle</*doPvRefit*/ true, CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -687,7 +721,7 @@ struct HfCandidateCreator3Prong {
687721
/// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0C
688722
void processNoPvRefitWithKFParticleCentFT0C(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Cs> const& collisions,
689723
FilteredHf3Prongs const& rowsTrackIndexProng3,
690-
aod::TracksWCovExtra const& tracks,
724+
TracksWCovExtraPidPiKaPr const& tracks,
691725
aod::BCsWithTimestamps const& bcWithTimeStamps)
692726
{
693727
runCreator3ProngWithKFParticle</*doPvRefit*/ false, CentralityEstimator::FT0C>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -703,7 +737,7 @@ struct HfCandidateCreator3Prong {
703737
/// @brief process function using DCA fitter w/ PV refit and w/ centrality selection on FT0M
704738
void processPvRefitWithDCAFitterNCentFT0M(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const& collisions,
705739
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
706-
aod::TracksWCovExtra const& tracks,
740+
TracksWCovExtraPidPiKaPr const& tracks,
707741
aod::BCsWithTimestamps const& bcWithTimeStamps)
708742
{
709743
runCreator3ProngWithDCAFitterN</*doPvRefit*/ true, CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -713,7 +747,7 @@ struct HfCandidateCreator3Prong {
713747
/// @brief process function using DCA fitter w/o PV refit and w/ centrality selection on FT0M
714748
void processNoPvRefitWithDCAFitterNCentFT0M(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const& collisions,
715749
FilteredHf3Prongs const& rowsTrackIndexProng3,
716-
aod::TracksWCovExtra const& tracks,
750+
TracksWCovExtraPidPiKaPr const& tracks,
717751
aod::BCsWithTimestamps const& bcWithTimeStamps)
718752
{
719753
runCreator3ProngWithDCAFitterN</*doPvRefit*/ false, CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -723,7 +757,7 @@ struct HfCandidateCreator3Prong {
723757
/// @brief process function using KFParticle package w/ PV refit and w/ centrality selection on FT0M
724758
void processPvRefitWithKFParticleCentFT0M(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const& collisions,
725759
FilteredPvRefitHf3Prongs const& rowsTrackIndexProng3,
726-
aod::TracksWCovExtra const& tracks,
760+
TracksWCovExtraPidPiKaPr const& tracks,
727761
aod::BCsWithTimestamps const& bcWithTimeStamps)
728762
{
729763
runCreator3ProngWithKFParticle</*doPvRefit*/ true, CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);
@@ -733,7 +767,7 @@ struct HfCandidateCreator3Prong {
733767
/// @brief process function using KFParticle package w/o PV refit and w/ centrality selection on FT0M
734768
void processNoPvRefitWithKFParticleCentFT0M(soa::Join<aod::Collisions, aod::EvSels, aod::CentFT0Ms> const& collisions,
735769
FilteredHf3Prongs const& rowsTrackIndexProng3,
736-
aod::TracksWCovExtra const& tracks,
770+
TracksWCovExtraPidPiKaPr const& tracks,
737771
aod::BCsWithTimestamps const& bcWithTimeStamps)
738772
{
739773
runCreator3ProngWithKFParticle</*doPvRefit*/ false, CentralityEstimator::FT0M>(collisions, rowsTrackIndexProng3, tracks, bcWithTimeStamps);

0 commit comments

Comments
 (0)