Skip to content

Commit d6f1f4c

Browse files
author
Mattia Faggin
committed
Address comments from Vit.
1 parent f661a06 commit d6f1f4c

2 files changed

Lines changed: 27 additions & 20 deletions

File tree

PWGHF/TableProducer/candidateCreator3Prong.cxx

Lines changed: 25 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -214,6 +214,23 @@ struct HfCandidateCreator3Prong {
214214
setLabelHistoCands(hCandidates);
215215
}
216216

217+
template <typename TRK, typename TAB0PI, typename TAB0KA, typename TAB0PR, typename TAB1PI, typename TAB1KA, typename TAB1PR, typename TAB2PI, typename TAB2KA, typename TAB2PR>
218+
void fillProngsPid(TRK const& track0, TRK const& track1, TRK const& track2,
219+
TAB0PI& rowProng0PidPi, TAB0KA& rowProng0PidKa, TAB0PR& rowProng0PidPr,
220+
TAB1PI& rowProng1PidPi, TAB1KA& rowProng1PidKa, TAB1PR& rowProng1PidPr,
221+
TAB2PI& rowProng2PidPi, TAB2KA& rowProng2PidKa, TAB2PR& rowProng2PidPr)
222+
{
223+
fillProngPid<HfProngSpecies::Pion>(track0, rowProng0PidPi);
224+
fillProngPid<HfProngSpecies::Kaon>(track0, rowProng0PidKa);
225+
fillProngPid<HfProngSpecies::Proton>(track0, rowProng0PidPr);
226+
fillProngPid<HfProngSpecies::Pion>(track1, rowProng1PidPi);
227+
fillProngPid<HfProngSpecies::Kaon>(track1, rowProng1PidKa);
228+
fillProngPid<HfProngSpecies::Proton>(track1, rowProng1PidPr);
229+
fillProngPid<HfProngSpecies::Pion>(track2, rowProng2PidPi);
230+
fillProngPid<HfProngSpecies::Kaon>(track2, rowProng2PidKa);
231+
fillProngPid<HfProngSpecies::Proton>(track2, rowProng2PidPr);
232+
}
233+
217234
template <bool doPvRefit = false, o2::hf_centrality::CentralityEstimator centEstimator, typename Coll, typename Cand>
218235
void runCreator3ProngWithDCAFitterN(Coll const&,
219236
Cand const& rowsTrackIndexProng3,
@@ -358,15 +375,10 @@ struct HfCandidateCreator3Prong {
358375
rowTrackIndexProng3.hfflag());
359376

360377
// 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);
378+
fillProngsPid(track0, track1, track2,
379+
rowProng0PidPi, rowProng0PidKa, rowProng0PidPr,
380+
rowProng1PidPi, rowProng1PidKa, rowProng1PidPr,
381+
rowProng2PidPi, rowProng2PidKa, rowProng2PidPr);
370382

371383
// fill histograms
372384
if (fillHistograms) {
@@ -613,15 +625,10 @@ struct HfCandidateCreator3Prong {
613625
chi2geo, ldl.first, ldl.second, chi2topo);
614626

615627
// 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);
628+
fillProngsPid(track0, track1, track2,
629+
rowProng0PidPi, rowProng0PidKa, rowProng0PidPr,
630+
rowProng1PidPi, rowProng1PidKa, rowProng1PidPr,
631+
rowProng2PidPi, rowProng2PidKa, rowProng2PidPr);
625632

626633
// fill histograms
627634
if (fillHistograms) {

PWGHF/TableProducer/treeCreatorLcToPKPi.cxx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,10 @@ struct HfTreeCreatorLcToPKPi {
521521
rowCandidateMC.reserve(candidates.size() * 2);
522522
}
523523
for (const auto& candidate : candidates) {
524-
auto trackPos1 = candidate.template prong0_as<soa::Join<TracksWPid, o2::aod::McTrackLabels>>(); // positive daughter (negative for the antiparticles)
524+
float trackPos1Pt = candidate.ptProng0();
525525
auto collision = candidate.template collision_as<Colls>();
526526
auto fillTable = [&](int candFlag) {
527-
double pseudoRndm = trackPos1.pt() * 1000. - static_cast<int64_t>(trackPos1.pt() * 1000);
527+
double pseudoRndm = trackPos1Pt * 1000. - static_cast<int64_t>(trackPos1Pt * 1000);
528528
const int functionSelection = candFlag == 0 ? candidate.isSelLcToPKPi() : candidate.isSelLcToPiKP();
529529
const int sigbgstatus = determineSignalBgStatus(candidate, candFlag);
530530
const bool isMcCandidateSignal = (sigbgstatus == Prompt) || (sigbgstatus == NonPrompt);

0 commit comments

Comments
 (0)