Skip to content

[PWGHF/HFC] Adding initial setup for correlation and event mixing at MC truth level#16061

Draft
deependra170598 wants to merge 6 commits intoAliceO2Group:masterfrom
deependra170598:hfc-mc-correlation
Draft

[PWGHF/HFC] Adding initial setup for correlation and event mixing at MC truth level#16061
deependra170598 wants to merge 6 commits intoAliceO2Group:masterfrom
deependra170598:hfc-mc-correlation

Conversation

@deependra170598
Copy link
Copy Markdown
Contributor

Hi @gluparel, @apalasciano and @singhra1994 !

In this PR, the most important changes are:

MC Gen Data Model Extensions:

  • Introduced new tables: DstarHadronMcGenPair for D*-hadron MC Gen pairs and DstarHadronGenInfo for associated MC Gen information.

MC Gen Pair Building Logic:

  • Implemented processSeMcGen and processMcGenME functions in correlatorDstarHadrons.cxx to build D*-hadron pairs at MC Gen same-event and mixed-event levels, respectively.
  • Registered new output tables for MC Gen pairs in the correlator.

MC Gen Histogramming in Analysis Task:

  • Added new THnSparse for MC Gen correlations (inclusive, prompt, non-prompt) in the analysis task.

Work is in progress and let me know if any suggestion or changes are required. Thanks

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 1, 2026

O2 linter results: ❌ 0 errors, ⚠️ 0 warnings, 🔕 0 disabled

deependra170598 added a commit to deependra170598/O2Physics that referenced this pull request May 1, 2026
Please consider the following formatting changes to AliceO2Group#16061
const auto groupedMcParticles = mcParticles.sliceBy(perCollisionCandMcGen, mcCollision.globalIndex());
const auto groupedCollisions = collisions.sliceBy(collPerMcCollision, mcCollision.globalIndex());

if (groupedCollisions.size() < 1) {
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.

Does this not work?

Suggested change
if (groupedCollisions.size() < 1) {
if (groupedCollisions.empty()) {

PROCESS_SWITCH(HfCorrelatorDstarHadrons, processSeMcGen, "Process MC Gen same-event mode", false);

/// D*-Hadron correlation pair builder at MC Gen mixed-event level
void processMcGenME(McCollisionsWithMult const& collisions,
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.

The two process functions have a very big overlap. Factor the common part out if possible to reduce the code duplication.

/// \author Fabrizio Grosa <fabrizio.grosa@cern.ch>, CERN
/// \author Shyam Kumar <shyam.kumar@cern.ch>

/// \brief Task to strore correlations between D* and hadrons.
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.

Suggested change
/// \brief Task to strore correlations between D* and hadrons.
/// \brief Task to store correlations between D* and hadrons.

} else {
efficiencyWeightDstar = vecHistEfficiencyDstar[0]->GetBinContent(vecHistEfficiencyDstar[0]->GetXaxis()->FindBin(ptDstar));
if (!efficiencyWeightDstar) {
if (efficiencyWeightDstar == 0.0) {
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.

Don't compare double values to 0.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Development

Successfully merging this pull request may close these issues.

2 participants