Skip to content

Commit 510255e

Browse files
committed
[PWGHF] Add D0 into correlatorFlowCharmHadrons and separate the HfcRedCharmHads to HfcRedCharmHads2P and HfcRedCharmHads3P
1 parent 686c3db commit 510255e

2 files changed

Lines changed: 71 additions & 6 deletions

File tree

PWGHF/HFC/DataModel/DerivedDataCorrelationTables.h

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,17 @@ DECLARE_SOA_TABLE(DsCandSelInfos, "AOD", "DSCANDSELINFO", //! Table with Ds cand
8181
aod::hf_candidate_reduced::BdtScorePrompt,
8282
aod::hf_candidate_reduced::BdtScoreBkg);
8383

84-
DECLARE_SOA_TABLE(HfcRedCharmHads, "AOD", "HFCREDCHARMHAD", //! Table with charm hadron candidate info
84+
DECLARE_SOA_TABLE(HfcRedCharmHads2P, "AOD", "HFCREDCHARMHAD2P", //! Table with charm hadron candidate info
85+
soa::Index<>,
86+
aod::hf_candidate_reduced::HfcRedFlowCollId,
87+
aod::hf_candidate_reduced::PhiCand,
88+
aod::hf_candidate_reduced::EtaCand,
89+
aod::hf_candidate_reduced::PtCand,
90+
aod::hf_candidate_reduced::InvMassCharmHad,
91+
aod::hf_candidate_reduced::Prong0Id,
92+
aod::hf_candidate_reduced::Prong1Id);
93+
94+
DECLARE_SOA_TABLE(HfcRedCharmHads3P, "AOD", "HFCREDCHARMHAD3P", //! Table with charm hadron candidate info
8595
soa::Index<>,
8696
aod::hf_candidate_reduced::HfcRedFlowCollId,
8797
aod::hf_candidate_reduced::PhiCand,

PWGHF/HFC/TableProducer/correlatorFlowCharmHadrons.cxx

Lines changed: 60 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,16 @@ using namespace o2::hf_evsel;
5151
enum DecayChannel {
5252
DplusToPiKPi = 0,
5353
DsToKKPi,
54-
DsToPiKK
54+
DsToPiKK,
55+
D0ToPiK,
56+
D0ToKPi
5557
};
5658

5759
/// Code to select collisions with at least one Ds meson
5860
struct HfCorrelatorFlowCharmHadrons {
5961
Produces<aod::HfcRedFlowColls> rowCollisions;
60-
Produces<aod::HfcRedCharmHads> rowCharmCandidates;
62+
Produces<aod::HfcRedCharmHads2P> rowCharmCandidates2P;
63+
Produces<aod::HfcRedCharmHads3P> rowCharmCandidates3P;
6164
Produces<aod::HfcRedCharmMls> rowCharmCandidatesMl;
6265
Produces<aod::HfcRedTrkAssoc> rowAssocTrackReduced;
6366
Produces<aod::HfcRedTrkSels> rowAssocTrackSelInfo;
@@ -86,18 +89,23 @@ struct HfCorrelatorFlowCharmHadrons {
8689
using CollsWithCentMult = soa::Join<aod::Collisions, aod::EvSels, aod::FT0Mults, aod::FV0Mults, aod::CentFT0Ms, aod::CentFT0As, aod::CentFT0Cs, aod::CentFV0As>;
8790
using CandDsDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDsToKKPi, aod::HfMlDsToKKPi>>;
8891
using CandDplusDataWMl = soa::Filtered<soa::Join<aod::HfCand3Prong, aod::HfSelDplusToPiKPi, aod::HfMlDplusToPiKPi>>;
92+
using CandD0DataWMl = soa::Filtered<soa::Join<aod::HfCand2Prong, aod::HfSelD0, aod::HfMlD0>>;
8993
using TracksData = soa::Filtered<soa::Join<aod::TracksWDca, aod::TrackSelection, aod::TracksExtra>>;
9094

9195
Filter filterSelectDsCandidates = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag || aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag;
9296
Filter filterSelectDplusCandidates = aod::hf_sel_candidate_dplus::isSelDplusToPiKPi >= selectionFlag;
97+
Filter filterSelectD0Candidates = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag || aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag;
9398
Filter filterSelectTrackData = (nabs(aod::track::eta) < etaTrackMax) && (aod::track::pt > ptTrackMin) && (aod::track::pt < ptTrackMax) && (nabs(aod::track::dcaXY) < dcaXYTrackMax) && (nabs(aod::track::dcaZ) < dcaZTrackMax);
9499

95100
Preslice<CandDsDataWMl> candsDsPerCollWMl = aod::hf_cand::collisionId;
96101
Preslice<CandDplusDataWMl> candsDplusPerCollWMl = aod::hf_cand::collisionId;
102+
Preslice<CandD0DataWMl> candsD0PerCollWMl = aod::hf_cand::collisionId;
97103
Preslice<TracksData> trackIndicesPerColl = aod::track::collisionId;
98104

99105
Partition<CandDsDataWMl> selectedDsToKKPiWMl = aod::hf_sel_candidate_ds::isSelDsToKKPi >= selectionFlag;
100106
Partition<CandDsDataWMl> selectedDsToPiKKWMl = aod::hf_sel_candidate_ds::isSelDsToPiKK >= selectionFlag;
107+
Partition<CandD0DataWMl> selectedD0ToPiKWMl = aod::hf_sel_candidate_d0::isSelD0 >= selectionFlag;
108+
Partition<CandD0DataWMl> selectedD0ToKPiWMl = aod::hf_sel_candidate_d0::isSelD0bar >= selectionFlag;
101109

102110
HistogramRegistry registry{"registry", {}};
103111

@@ -107,6 +115,11 @@ struct HfCorrelatorFlowCharmHadrons {
107115
massCharm = o2::constants::physics::MassDPlus;
108116
} else if (doprocessDsWithMl) {
109117
massCharm = o2::constants::physics::MassDS;
118+
} else if (doprocessD0WithMl) {
119+
massCharm = o2::constants::physics::MassD0;
120+
} else {
121+
LOG(fatal) << "No decay channel selected to process";
122+
std::abort();
110123
}
111124

112125
hfEvSel.addHistograms(registry); // collision monitoring
@@ -161,6 +174,12 @@ struct HfCorrelatorFlowCharmHadrons {
161174
if constexpr (channel == DecayChannel::DplusToPiKPi) {
162175
return hfHelper.invMassDplusToPiKPi(candidate);
163176
}
177+
if constexpr (channel == DecayChannel::D0ToPiK) {
178+
return hfHelper.invMassD0ToPiK(candidate);
179+
}
180+
if constexpr (channel == DecayChannel::D0ToKPi) {
181+
return hfHelper.invMassD0barToKPi(candidate);
182+
}
164183
return -1.;
165184
}
166185

@@ -185,6 +204,16 @@ struct HfCorrelatorFlowCharmHadrons {
185204
outputMl[iclass] = candidate.mlProbDplusToPiKPi()[classMl->at(iclass)];
186205
}
187206
}
207+
if constexpr (channel == DecayChannel::D0ToPiK) {
208+
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
209+
outputMl[iclass] = candidate.mlProbD0()[classMl->at(iclass)];
210+
}
211+
}
212+
if constexpr (channel == DecayChannel::D0ToKPi) {
213+
for (unsigned int iclass = 0; iclass < classMl->size(); iclass++) {
214+
outputMl[iclass] = candidate.mlProbD0bar()[classMl->at(iclass)];
215+
}
216+
}
188217
return outputMl;
189218
}
190219

@@ -199,8 +228,11 @@ struct HfCorrelatorFlowCharmHadrons {
199228
continue;
200229
}
201230
double massCand = getCandMass<channel>(candidate);
202-
rowCharmCandidates(indexRedColl, candidate.phi(), candidate.eta(), candidate.pt(), massCand, candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
203-
231+
if constexpr (channel == DecayChannel::D0ToKPi || channel == DecayChannel::D0ToPiK) {
232+
rowCharmCandidates2P(indexRedColl, candidate.phi(), candidate.eta(), candidate.pt(), massCand, candidate.prong0Id(), candidate.prong1Id());
233+
} else {
234+
rowCharmCandidates3P(indexRedColl, candidate.phi(), candidate.eta(), candidate.pt(), massCand, candidate.prong0Id(), candidate.prong1Id(), candidate.prong2Id());
235+
}
204236
std::vector<float> outputMl = getCandMlScores<channel>(candidate);
205237
rowCharmCandidatesMl(indexRedColl, outputMl[0], outputMl[1]);
206238
}
@@ -264,9 +296,32 @@ struct HfCorrelatorFlowCharmHadrons {
264296
}
265297
}
266298
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processDsWithMl, "Process Ds candidates with ML info", false);
299+
300+
// D0 with ML selections
301+
void processD0WithMl(CollsWithCentMult const& colls,
302+
TracksData const& tracks,
303+
CandD0DataWMl const&)
304+
{
305+
for (const auto& coll : colls) {
306+
auto thisCollId = coll.globalIndex();
307+
auto candsD0ToPiKWMl = selectedD0ToPiKWMl->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache);
308+
auto candsD0ToKPiWMl = selectedD0ToKPiWMl->sliceByCached(aod::hf_cand::collisionId, thisCollId, cache);
309+
if (forceCharmInCollision && candsD0ToPiKWMl.size() < 1 && candsD0ToKPiWMl.size() < 1) {
310+
continue;
311+
}
312+
if (!checkAndFillCollision(coll)) {
313+
continue;
314+
}
315+
auto trackIdsThisColl = tracks.sliceBy(trackIndicesPerColl, thisCollId);
316+
fillCharmHadronTables<DecayChannel::D0ToPiK>(candsD0ToPiKWMl);
317+
fillCharmHadronTables<DecayChannel::D0ToKPi>(candsD0ToKPiWMl);
318+
fillTracksTables(trackIdsThisColl);
319+
}
320+
}
321+
PROCESS_SWITCH(HfCorrelatorFlowCharmHadrons, processD0WithMl, "Process D0 candidates with ML info", false);
267322
};
268323

269324
WorkflowSpec defineDataProcessing(ConfigContext const& cfgc)
270325
{
271326
return WorkflowSpec{adaptAnalysisTask<HfCorrelatorFlowCharmHadrons>(cfgc)};
272-
}
327+
}

0 commit comments

Comments
 (0)