Skip to content

[PWGEM,PWGHF] Clean up code-check errors and warnings - #17285

Open
mhemmer-cern wants to merge 3 commits into
AliceO2Group:masterfrom
mhemmer-cern:clean-up
Open

[PWGEM,PWGHF] Clean up code-check errors and warnings#17285
mhemmer-cern wants to merge 3 commits into
AliceO2Group:masterfrom
mhemmer-cern:clean-up

Conversation

@mhemmer-cern

Copy link
Copy Markdown
Collaborator

Clean up some code-check errors and warnings in the PWGEM/PhotonMeson/Utils part. Resulting changes affected also one code in HF so I touched that one file and fixed the things there too. I hope that's okay.

@github-actions

github-actions Bot commented Aug 1, 2026

Copy link
Copy Markdown

O2 linter results: ❌ 181 errors, ⚠️ 300 warnings, 🔕 16 disabled

@mhemmer-cern
mhemmer-cern enabled auto-merge (squash) August 1, 2026 20:48
@mhemmer-cern
mhemmer-cern disabled auto-merge August 1, 2026 20:49
@alibuild

alibuild commented Aug 1, 2026

Copy link
Copy Markdown
Collaborator

Error while checking build/O2Physics/code-check for 6af663d at 2026-08-02 07:48:

## sw/BUILD/O2Physics-code-check-latest/log
--
========== List of issues found ==========
++ echo 'Found 43 errors and 0 warnings.'
Found 43 errors and 0 warnings.
++ [[ 43 -gt 0 ]]
++ cat /sw/BUILD/46b5bb01afa9e8de2a22b60feb8b410f210c1b35/O2Physics-code-check/errors.txt
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:19:10: error: 'PWGEM/PhotonMeson/Core/EMCPhotonCut.h' file not found [clang-diagnostic-error]
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:27:1: error: included header TH2.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:29:1: error: included header array is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:31:1: error: included header string_view is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/EventHistograms.h:19:10: error: 'Common/CCDB/EventSelectionParams.h' file not found [clang-diagnostic-error]
PWGEM/PhotonMeson/Utils/EventHistograms.h:29:1: error: included header string_view is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/HNMUtilities.h:20:10: error: 'PWGEM/PhotonMeson/DataModel/gammaTables.h' file not found [clang-diagnostic-error]
PWGEM/PhotonMeson/Utils/HNMUtilities.h:36:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/HNMUtilities.h:103:11: error: variable 'massHNM' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/HNMUtilities.h:186:77: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/NMHistograms.h:19:10: error: 'PWGEM/PhotonMeson/Utils/MCUtilities.h' file not found [clang-diagnostic-error]
PWGEM/PhotonMeson/Utils/NMHistograms.h:32:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/NMHistograms.h:88:7: error: variable 'motherid_strhad' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:19:10: error: 'Common/Core/RecoDecay.h' file not found [clang-diagnostic-error]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:22:1: error: included header MathConstants.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:44:9: error: variable 'momTot' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:45:9: error: variable 'lQlNeg' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:46:9: error: variable 'lQlPos' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:52:9: error: variable 'momTot' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:53:9: error: variable 'dp' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:74:9: error: variable 'alphaPos' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGEM/PhotonMeson/Utils/PCMUtilities.h:75:9: error: variable 'alphaNeg' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:25:10: error: 'PWGHF/Core/CentralityEstimation.h' file not found [clang-diagnostic-error]
PWGHF/D2H/Core/DataCreationCharmReso.h:41:1: error: included header Propagator.h is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:63:1: error: included header map is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:65:1: error: included header type_traits is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:66:1: error: included header vector is not used directly [misc-include-cleaner,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:291:15: error: variable 'nChannels' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:341:15: error: variable 'momTot' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:342:15: error: variable 'lQlPos' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:343:15: error: variable 'lQlNeg' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:354:9: error: variable 'momTot' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:355:9: error: variable 'dp' is not initialized [cppcoreguidelines-init-variables,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1400:40: error: no header providing "o2::track::TrackPar" is directly included [misc-include-cleaner,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1413:13: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1443:13: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1466:13: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1527:57: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1542:57: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1558:57: error: repeated branch body in conditional chain [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1618:13: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
PWGHF/D2H/Core/DataCreationCharmReso.h:1638:13: error: if with identical then and else branches [bugprone-branch-clone,-warnings-as-errors]
[0 more errors; see full log]

Full log here.

@mhemmer-cern
mhemmer-cern marked this pull request as draft August 2, 2026 11:53
@mhemmer-cern

Copy link
Copy Markdown
Collaborator Author

@vkucera something is wrong with the code-check result here.
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:19:10: error: 'PWGEM/PhotonMeson/Core/EMCPhotonCut.h' file not found [clang-diagnostic-error]
The file is there and otherwise wouldn't compilation break?
PWGEM/PhotonMeson/Utils/ClusterHistograms.h:27:1: error: included header TH2.h is not used directly [misc-include-cleaner,-warnings-as-errors]
TH2 is used in line 74
array is used in line 117...
and so on.

Locally when checking my branch with these commit vs upstream/master I am not getting any of these false errors.

@vkucera

vkucera commented Aug 2, 2026

Copy link
Copy Markdown
Collaborator

@mhemmer-cern Indeed, I cannot reproduce it either locally. It seems like Clang-Tidy cannot find the correct compilation command for the header in the database.

@mhemmer-cern

Copy link
Copy Markdown
Collaborator Author

@mhemmer-cern Indeed, I cannot reproduce it either locally. It seems like Clang-Tidy cannot find the correct compilation command for the header in the database.

Then I will mark this a ready for review.

@mhemmer-cern
mhemmer-cern marked this pull request as ready for review August 2, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

photon Photon and neutral meson PAG label pwgem pwghf PWG-HF

Development

Successfully merging this pull request may close these issues.

3 participants