Skip to content

[PWGCF] FemtoUniverse: Add 3D histogram of TOF Nsigma, pT and centrality for purity studies#16960

Merged
prchakra merged 1 commit into
AliceO2Group:masterfrom
alicja-pp:femtouniverse_nsigma
Jul 8, 2026
Merged

[PWGCF] FemtoUniverse: Add 3D histogram of TOF Nsigma, pT and centrality for purity studies#16960
prchakra merged 1 commit into
AliceO2Group:masterfrom
alicja-pp:femtouniverse_nsigma

Conversation

@alicja-pp

Copy link
Copy Markdown
Contributor

PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:
add 3D histogram of TOF Nsigma, pT and centrality for purity studies
TOF Nsigma axis can be set with confTOFnSigmaBins configurable

@github-actions github-actions Bot added the pwgcf label Jul 8, 2026
@github-actions github-actions Bot changed the title FemtoUniverse: Add 3D histogram of TOF Nsigma, pT and centrality for purity studies [PWGCF] FemtoUniverse: Add 3D histogram of TOF Nsigma, pT and centrality for purity studies Jul 8, 2026
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown

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

@alibuild

alibuild commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 0eb4189 at 2026-07-08 13:11:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 46 errors and 19 warnings.'
Found 46 errors and 19 warnings.
++ [[ 46 -gt 0 ]]
++ cat /sw/BUILD/3d7850a144a2e2bc8b9646e67dac40dff3c96071/O2Physics-code-check/errors.txt
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:65:22: error: 'Npart' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:66:22: error: 'Ncuts' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:67:39: error: 'partNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:68:39: error: 'cutNames' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:69:14: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:69:20: error: 'cutsTable' is a static definition in anonymous namespace; static is redundant here [readability-static-definition-in-anonymous-namespace,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:72:8: error: constructor does not initialize these fields: pdg, vPIDPartOne, vPIDPartTwo, randgen [cppcoreguidelines-pro-type-member-init,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:86:69: error: do not implicitly decay an array into a pointer; consider using gsl::array_view or an explicit cast instead [cppcoreguidelines-pro-bounds-array-to-pointer-decay,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:276:7: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:284:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:285:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:286:5: error: do not declare C-style arrays, use 'std::array' instead [modernize-avoid-c-arrays,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:288:42: error: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:291:9: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:332:7: error: do not use 'else' after 'return' [readability-else-after-return,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:333:7: error: switching on non-enum value without default case may not cover all cases [bugprone-switch-missing-default-case,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:361:46: error: the parameter 'part' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:474:36: error: the parameter 'col' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:495:34: error: the parameter 'groupPartsOne' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:495:63: error: the parameter 'groupPartsTwo' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:495:87: error: the parameter 'parts' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:545:18: error: variable 'rand' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:584:18: error: variable 'rand' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:610:36: error: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:630:36: error: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:672:85: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:676:85: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:678:85: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:697:84: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:701:84: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:703:84: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:719:35: error: the parameter 'groupPartsOne' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:719:64: error: the parameter 'groupPartsTwo' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:719:88: error: the parameter 'parts' is copied for each invocation but only used as a const reference; consider making it a const reference [performance-unnecessary-value-param,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:737:16: error: variable 'rand' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:768:34: error: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:788:34: error: redundant boolean literal supplied to boolean operator [readability-simplify-boolean-expr,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:820:35: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:861:35: error: narrowing conversion from 'unwrap_t<float>' (aka 'float') to 'int' [bugprone-narrowing-conversions,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:912:16: error: variable 'rand' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:930:7: error: switching on non-enum value without default case may not cover all cases [bugprone-switch-missing-default-case,-warnings-as-errors]
PWGCF/FemtoUniverse/Tasks/femtoUniversePairTaskTrackTrackMultKtExtended.cxx:949:7: error: switching on non-enum value without default case may not cover all cases [bugprone-switch-missing-default-case,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

@prchakra prchakra merged commit c911579 into AliceO2Group:master Jul 8, 2026
12 of 15 checks passed
@alicja-pp alicja-pp deleted the femtouniverse_nsigma branch July 8, 2026 11:56
Comment on lines +363 to +375
switch (PDGcode) {
case 2212: // Proton+
case -2212: // Proton-
return trackCuts.getNsigmaTOF(part, o2::track::PID::Proton);
case 211: // Pion+
case -211: // Pion-
case 111: // Pion 0
return trackCuts.getNsigmaTOF(part, o2::track::PID::Pion);
case 321: // Kaon+
case -321: // Kaon-
case 130: // Kaon 0 LONG
case 310: // Kaon 0 SHORT
return trackCuts.getNsigmaTOF(part, o2::track::PID::Kaon);

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.

Why are you using magic numbers instead of named constants?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I am correcting it now. The linter did not point out the issues in those changes.

@vkucera

vkucera commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

@prchakra Why did you approve the PR despite the errors and bugs?

@prchakra

prchakra commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hi @vkucera, most of the errors reported by build/O2Physics/code-check are not newly introduced (I overlooked the one at L361). And by bugs if you're referring to the ones with magic numbers, they weren't flagged by o2-linter. That's why I approved them.

@vkucera

vkucera commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hi @vkucera, most of the errors reported by build/O2Physics/code-check are not newly introduced (I overlooked the one at L361). And by bugs if you're referring to the ones with magic numbers, they weren't flagged by o2-linter. That's why I approved them.

The bugs I am referring to are the uninitialised variables and members and narrowing conversions detected by the code check.

@prchakra

prchakra commented Jul 8, 2026

Copy link
Copy Markdown
Collaborator

Hi @vkucera, most of the errors reported by build/O2Physics/code-check are not newly introduced (I overlooked the one at L361). And by bugs if you're referring to the ones with magic numbers, they weren't flagged by o2-linter. That's why I approved them.

The bugs I am referring to are the uninitialised variables and members and narrowing conversions detected by the code check.

Yes, as they were not newly introduced and could require a bit of time to fix them all, I approved them. Anyway, some of them will be fixed now by @alicja-pp.

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.

4 participants