Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions PWGHF/D2H/Tasks/taskDplus.cxx
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ struct HfTaskDplus {
Configurable<int> occEstimator{"occEstimator", 0, "Occupancy estimation (None: 0, ITS: 1, FT0C: 2)"};
Configurable<std::vector<double>> binsPt{"binsPt", std::vector<double>{hf_cuts_dplus_to_pi_k_pi::vecBinsPt}, "pT bin limits"};
Configurable<std::vector<int>> classMl{"classMl", {0, 1, 2}, "Indexes of ML scores to be stored. Three indexes max."};
Configurable<bool> storeRecRapidity{"storeRecRapidity", false, "Flag to store rec. rapidity information in MC THnSparse"};
Configurable<bool> storeCentrality{"storeCentrality", false, "Flag to store centrality information"};
Configurable<bool> storeOccupancy{"storeOccupancy", false, "Flag to store occupancy information"};
Configurable<bool> storeIR{"storeIR", false, "Flag to store interaction rate information"};
Expand Down Expand Up @@ -260,6 +261,10 @@ struct HfTaskDplus {
axes.insert(axes.end(), {thnAxisMlScore0, thnAxisMlScore1, thnAxisMlScore2});
axesFD.insert(axesFD.end(), {thnAxisMlScore0, thnAxisMlScore1, thnAxisMlScore2});
}
if (storeRecRapidity) {
axes.push_back(thnAxisY);
axesFD.push_back(thnAxisY);
}

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest you to put it at the end of all the configurable axes (after the other if (store...)); this because other analysers expect axes in a given position, and adding this now might change the position of axes in the outputs, creating confusion in other analyses

if (storeCentrality) {
axes.push_back(thnAxisCent);
axesFD.push_back(thnAxisCent);
Expand Down Expand Up @@ -367,6 +372,8 @@ struct HfTaskDplus {
registry.fill(HIST("hSparseMassPrompt"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], occupancy);
} else if (!storeCentrality && !storeOccupancy && storePvContributors) {
registry.fill(HIST("hSparseMassPrompt"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], numPvContributors);
} else if (!storeCentrality && !storeOccupancy && storeRecRapidity) {
registry.fill(HIST("hSparseMassPrompt"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], HfHelper::yDplus(candidate));
Comment on lines +375 to +376

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you should in principle add all the combinations, in fact currently if a user enables rapidity the rapidity with other optional variables, it gives a runtime error (or you forbid the activation of rapidity with other optional variables, throwing a FATAL with a meaningful error message)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@lmattei01, one more suggestion: you can pack all the values to be filled (depending on boolean configurables) to the vector and then call the Fill() function only once. Otherwise when you attempt to foresee all the combinations, the number of LOC will grow in geometric progression.
As a reference you can have a look at the similar code for Lc baryon https://github.com/AliceO2Group/O2Physics/blob/dfbc8da2c9f7ff7cbd1f2cfed3787a3a45510ebb/PWGHF/D2H/Tasks/taskLc.cxx

} else {
registry.fill(HIST("hSparseMassPrompt"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
}
Expand All @@ -381,6 +388,8 @@ struct HfTaskDplus {
registry.fill(HIST("hSparseMassFD"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], occupancy, ptbhad, flagBHad);
} else if (!storeCentrality && !storeOccupancy && storePvContributors) {
registry.fill(HIST("hSparseMassFD"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], numPvContributors, ptbhad, flagBHad);
} else if (!storeCentrality && !storeOccupancy && storeRecRapidity) {
registry.fill(HIST("hSparseMassFD"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], numPvContributors, ptbhad, flagBHad, HfHelper::yDplus(candidate));
} else {
registry.fill(HIST("hSparseMassFD"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], ptbhad, flagBHad);
}
Expand All @@ -395,6 +404,8 @@ struct HfTaskDplus {
registry.fill(HIST("hSparseMassBkg"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], occupancy);
} else if (!storeCentrality && !storeOccupancy && storePvContributors) {
registry.fill(HIST("hSparseMassBkg"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], numPvContributors);
} else if (!storeCentrality && !storeOccupancy && storeRecRapidity) {
registry.fill(HIST("hSparseMassBkg"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], HfHelper::yDplus(candidate));
} else {
registry.fill(HIST("hSparseMassBkg"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
}
Expand All @@ -409,6 +420,8 @@ struct HfTaskDplus {
registry.fill(HIST("hSparseMassNotMatched"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], occupancy);
} else if (!storeCentrality && !storeOccupancy && storePvContributors) {
registry.fill(HIST("hSparseMassNotMatched"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], numPvContributors);
} else if (!storeCentrality && !storeOccupancy && storeRecRapidity) {
registry.fill(HIST("hSparseMassNotMatched"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2], HfHelper::yDplus(candidate));
} else {
registry.fill(HIST("hSparseMassNotMatched"), HfHelper::invMassDplusToPiKPi(candidate), candidate.pt(), outputMl[0], outputMl[1], outputMl[2]);
}
Expand Down
Loading