Skip to content

Commit c774f2b

Browse files
authored
[PWGHF] Restore backward compatibility of Ds and D+ tasks (#9948)
1 parent bdece25 commit c774f2b

File tree

2 files changed

+22
-22
lines changed

2 files changed

+22
-22
lines changed

PWGHF/D2H/Tasks/taskDplus.cxx

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -178,11 +178,6 @@ struct HfTaskDplus {
178178
std::vector<AxisSpec> axesGenPrompt = {thnAxisPt, thnAxisY};
179179
std::vector<AxisSpec> axesGenFD = {thnAxisPt, thnAxisY};
180180

181-
axesFD.insert(axesFD.end(), {thnAxisPtBHad});
182-
axesFD.insert(axesFD.end(), {thnAxisFlagBHad});
183-
axesGenFD.insert(axesGenFD.end(), {thnAxisPtBHad});
184-
axesGenFD.insert(axesGenFD.end(), {thnAxisFlagBHad});
185-
186181
if (doprocessMcWithMl) {
187182
axes.insert(axes.end(), {thnAxisMlScore0, thnAxisMlScore1, thnAxisMlScore2});
188183
axesFD.insert(axesFD.end(), {thnAxisMlScore0, thnAxisMlScore1, thnAxisMlScore2});
@@ -199,6 +194,12 @@ struct HfTaskDplus {
199194
axesGenPrompt.insert(axesGenPrompt.end(), {thnAxisOccupancy});
200195
axesGenFD.insert(axesGenFD.end(), {thnAxisOccupancy});
201196
}
197+
198+
axesFD.insert(axesFD.end(), {thnAxisPtBHad});
199+
axesFD.insert(axesFD.end(), {thnAxisFlagBHad});
200+
axesGenFD.insert(axesGenFD.end(), {thnAxisPtBHad});
201+
axesGenFD.insert(axesGenFD.end(), {thnAxisFlagBHad});
202+
202203
registry.add("hSparseMassPrompt", "THn for Dplus Prompt", HistType::kTHnSparseF, axes);
203204
registry.add("hSparseMassFD", "THn for Dplus FD", HistType::kTHnSparseF, axesFD);
204205
if (fillMcBkgHistos) {
@@ -275,13 +276,13 @@ struct HfTaskDplus {
275276
} else if (candidate.originMcRec() == RecoDecay::OriginType::NonPrompt) { // FD
276277

277278
if (storeCentrality && storeOccupancy) {
278-
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), ptbhad, flagBHad, outputMl[0], outputMl[1], outputMl[2], centrality, occupancy);
279+
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], centrality, occupancy, ptbhad, flagBHad);
279280
} else if (storeCentrality && !storeOccupancy) {
280-
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), ptbhad, flagBHad, outputMl[0], outputMl[1], outputMl[2], centrality);
281+
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], centrality, ptbhad, flagBHad);
281282
} else if (!storeCentrality && storeOccupancy) {
282-
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), ptbhad, flagBHad, outputMl[0], outputMl[1], outputMl[2], occupancy);
283+
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], occupancy, ptbhad, flagBHad);
283284
} else {
284-
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), ptbhad, flagBHad, outputMl[0], outputMl[1], outputMl[2]);
285+
registry.fill(HIST("hSparseMassFD"), hfHelper.invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], ptbhad, flagBHad);
285286
}
286287

287288
} else { // Bkg
@@ -416,11 +417,11 @@ struct HfTaskDplus {
416417
}
417418
} else {
418419
if (storeCentrality && storeOccupancy) {
419-
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, ptGenB, flagGenB, centrality, occupancy);
420+
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, centrality, occupancy, ptGenB, flagGenB);
420421
} else if (storeCentrality && !storeOccupancy) {
421-
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, ptGenB, flagGenB, centrality);
422+
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, centrality, ptGenB, flagGenB);
422423
} else if (!storeCentrality && storeOccupancy) {
423-
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, ptGenB, flagGenB, occupancy);
424+
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, occupancy, ptGenB, flagGenB);
424425
} else {
425426
registry.fill(HIST("hSparseMassGenFD"), particle.pt(), yGen, ptGenB, flagGenB);
426427
}

PWGHF/D2H/Tasks/taskDs.cxx

Lines changed: 9 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -58,8 +58,7 @@ enum DataType { Data = 0,
5858
kDataTypes };
5959

6060
template <typename T>
61-
concept hasDsMlInfo = requires(T candidate)
62-
{
61+
concept hasDsMlInfo = requires(T candidate) {
6362
candidate.mlProbDsToKKPi();
6463
candidate.mlProbDsToPiKK();
6564
};
@@ -182,9 +181,9 @@ struct HfTaskDs {
182181
std::vector<AxisSpec> axesFd = {massbins, ptbins, centralitybins, ptBHad, flagBHad};
183182
std::vector<AxisSpec> axesFdMl = {massbins, ptbins, centralitybins, mlscore0bins, mlscore1bins, mlscore2bins, ptBHad, flagBHad};
184183
std::vector<AxisSpec> axesWithNpv = {massbins, ptbins, centralitybins, npvcontributorsbins};
185-
std::vector<AxisSpec> axesWithNpvMl = {massbins, ptbins, centralitybins, npvcontributorsbins, mlscore0bins, mlscore1bins, mlscore2bins};
184+
std::vector<AxisSpec> axesWithNpvMl = {massbins, ptbins, centralitybins, mlscore0bins, mlscore1bins, mlscore2bins, npvcontributorsbins};
186185
std::vector<AxisSpec> axesGenPrompt = {ptbins, ybins, npvcontributorsbins, centralitybins};
187-
std::vector<AxisSpec> axesGenFd = {ptbins, ybins, npvcontributorsbins, ptBHad, flagBHad, centralitybins};
186+
std::vector<AxisSpec> axesGenFd = {ptbins, ybins, npvcontributorsbins, centralitybins, ptBHad, flagBHad};
188187

189188
if (storeOccupancy) {
190189
axes.insert(axes.end(), {occupancybins});
@@ -464,10 +463,10 @@ struct HfTaskDs {
464463
}
465464
} else {
466465
if (storeOccupancy) {
467-
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.template collision_as<Coll>().numContrib(), outputMl[0], outputMl[1], outputMl[2], o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
466+
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as<Coll>().numContrib(), o2::hf_occupancy::getOccupancyColl(candidate.template collision_as<Coll>(), occEstimator));
468467
return;
469468
} else {
470-
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), candidate.template collision_as<Coll>().numContrib(), outputMl[0], outputMl[1], outputMl[2]);
469+
std::get<THnSparsePtr>(histosPtr[dataType]["hSparseMass"])->Fill(mass, pt, evaluateCentralityCand<Coll>(candidate), outputMl[0], outputMl[1], outputMl[2], candidate.template collision_as<Coll>().numContrib());
471470
return;
472471
}
473472
}
@@ -712,9 +711,9 @@ struct HfTaskDs {
712711
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
713712
float ptGenB = bHadMother.pt();
714713
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
715-
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);
714+
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, occ, ptGenB, flagGenB);
716715
} else {
717-
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent);
716+
std::get<THnSparsePtr>(histosPtr[DataType::McDsNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, ptGenB, flagGenB);
718717
}
719718
}
720719
} else if (fillDplusMc) {
@@ -738,9 +737,9 @@ struct HfTaskDs {
738737
int flagGenB = getBHadMotherFlag(bHadMother.pdgCode());
739738
float ptGenB = bHadMother.pt();
740739
if (storeOccupancy && occEstimator != o2::hf_occupancy::OccupancyEstimator::None) {
741-
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent, occ);
740+
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, occ, ptGenB, flagGenB);
742741
} else {
743-
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, ptGenB, flagGenB, cent);
742+
std::get<THnSparsePtr>(histosPtr[DataType::McDplusNonPrompt]["hSparseGen"])->Fill(pt, y, maxNumContrib, cent, ptGenB, flagGenB);
744743
}
745744
}
746745
}

0 commit comments

Comments
 (0)