Skip to content

Conversation

@JosueMtzGar
Copy link
Contributor

I am adding a new task for the calculus of two particle correlation in pp in order to calculate the baseline in a template fit

@github-actions github-actions bot added the pwgcf label Nov 11, 2025
@github-actions
Copy link

github-actions bot commented Nov 11, 2025

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

@github-actions github-actions bot changed the title PWGCF: Adding a task for two particle correlation in pp [PWGCF] Adding a task for two particle correlation in pp Nov 11, 2025
@JosueMtzGar
Copy link
Contributor Author

Hi reviewers

The errors remaining in the O2 linter correspond to workflow names from other task, I did not want to change them to not affect the work of other analysis. Could you approve this PR ignoring them? or Have I change the names to?

@alibuild
Copy link
Collaborator

alibuild commented Nov 11, 2025

Error while checking build/O2Physics/o2 for dacf271 at 2025-11-12 02:28:

## sw/BUILD/O2Physics-latest/log
/sw/SOURCES/O2Physics/13775-slc9_x86-64/0/PWGCF/TwoParticleCorrelations/Tasks/twoParticleCorrelationPp.cxx:273:49: error: unused parameter 'collision' [-Werror=unused-parameter]
ninja: build stopped: subcommand failed.

Full log here.

@victor-gonzalez
Copy link
Collaborator

@JosueMtzGar Please, fix the compiler error

Comment on lines 314 to 331
if (minMultiplicity <= multiplicity) {
histos.fill(HIST("sameEvent2D"), deltaEta, deltaPhi);
}
if (minMultiplicity <= multiplicity && multiplicity <= range1Max) {
histos.fill(HIST("sameEvent_2_10"), deltaEta, deltaPhi);
}
if (range2Min <= multiplicity && multiplicity <= range2Max) {
histos.fill(HIST("sameEvent_11_20"), deltaEta, deltaPhi);
}
if (range3Min <= multiplicity && multiplicity <= range3Max) {
histos.fill(HIST("sameEvent_21_30"), deltaEta, deltaPhi);
}
if (range4Min <= multiplicity && multiplicity <= range4Max) {
histos.fill(HIST("sameEvent_31_40"), deltaEta, deltaPhi);
}
if (range5Min <= multiplicity && multiplicity <= range5Max) {
histos.fill(HIST("sameEvent_41_50"), deltaEta, deltaPhi);
}
Copy link
Collaborator

@victor-gonzalez victor-gonzalez Nov 12, 2025

Choose a reason for hiding this comment

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

This is performed in a double inner loop of tracks, all the conditionals will be explored although only one, as much, will be true
This increase the execution CPU without any purpose
Is there a better way of implement it?

Copy link
Contributor Author

@JosueMtzGar JosueMtzGar Nov 13, 2025

Choose a reason for hiding this comment

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

Now, I am using a else if conditional and a final continue to reduce the steps in the exploration

Comment on lines 333 to 350
if (minMultiplicity <= multiplicity) {
histos.fill(HIST("mixedEvent2D"), deltaEta, deltaPhi);
}
if (minMultiplicity <= multiplicity && multiplicity <= range1Max) {
histos.fill(HIST("mixedEvent_2_10"), deltaEta, deltaPhi);
}
if (range2Min <= multiplicity && multiplicity <= range2Max) {
histos.fill(HIST("mixedEvent_11_20"), deltaEta, deltaPhi);
}
if (range3Min <= multiplicity && multiplicity <= range3Max) {
histos.fill(HIST("mixedEvent_21_30"), deltaEta, deltaPhi);
}
if (range4Min <= multiplicity && multiplicity <= range4Max) {
histos.fill(HIST("mixedEvent_31_40"), deltaEta, deltaPhi);
}
if (range5Min <= multiplicity && multiplicity <= range5Max) {
histos.fill(HIST("mixedEvent_41_50"), deltaEta, deltaPhi);
}
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same here

Comment on lines 163 to 166
struct SameEventTag {
};
struct MixedEventTag {
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why structs and not a single enum with two constant named values?

return true;
}

template <typename TTarget, typename TTracks, typename TTag>
Copy link
Collaborator

Choose a reason for hiding this comment

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

Why templating on TTag? Will not a single function argument work?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This was one way I found to implement a difference in the histogram filling between same and mixed events. Now I’ve figured out how to do this in the other tasks using an enum. I’m not sure which approach is more efficient, but I guess the enum is simpler.

Copy link
Collaborator

@victor-gonzalez victor-gonzalez left a comment

Choose a reason for hiding this comment

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

Please, fix linter warnings in the new code for the next iteration

@victor-gonzalez victor-gonzalez enabled auto-merge (squash) November 14, 2025 17:11
@victor-gonzalez
Copy link
Collaborator

BTW, you haven't replied to my questions about why the structs and why template on TTag

@victor-gonzalez victor-gonzalez merged commit a98d1e4 into AliceO2Group:master Nov 15, 2025
13 of 15 checks passed
lmattei01 pushed a commit to lmattei01/O2Physics that referenced this pull request Dec 5, 2025
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.

3 participants